How to get page number of certain text in the word document

Hi,

I am trying to search for specific text in the word document and find the page number in which the text was found in the document. I could able to find the text but could not able to get page number. Please help.

Thanks

Hi Rama,

Thanks for your query. Please read following documentation link for your kind reference. Hope this helps you. let me know, If you have any more queries.

https://docs.aspose.com/words/java/find-and-replace/

I regret to share with you that there is no built in method to find the page number of a node. However, there is a workaround to find page number. Please read following documentation link for .NET code. I will share Java code with you soon.

https://forum.aspose.com/t/65265

Hi,

Thanks for the update. However, I have another question. Is there a simple way to find the text instead of implementing the callback function?

Thanks,

Rama.

Hi Rama,

You can get the text from document by following line of code. You can find text from string variable by using string methods. Let us know, If you have any more queries.

string text = doc.Range.Text;

Hi there,

Thanks for your inquiry.

I’m afraid you will need to use the callback in order to find the Run node of specified text.

Thanks,

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(101)