This is a migrated thread and some comments may be shown as answers.

Search for number of occurrences of text into word document pagewise

1 Answer 51 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
Jyoti
Top achievements
Rank 1
Jyoti asked on 31 Jul 2018, 08:40 AM

Hi,

I need to get the the number of occurrences of a text into word document page wise. Is telerik wordProcessing supports searching for a text into word document  page wise? i.e. to search for a text into document page by page and find the number of occurrences.

I would appreciate if you can help me with this.

Thanks,
Savi

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 03 Aug 2018, 07:55 AM
Hi Savi,

A search functionality is currently not available in the API of RadWordsProcessing and we have logged a task to implement such. Please, make sure to cast your vote for the implementation as well as subscribe to track the status of the task using the related public item on our feedback portal. 

To achieve the desired goal, you could export the document to plain text and find the number of matches using the .NET methods. For example, you can do so using the Regex class:
TxtFormatProvider provider = new TxtFormatProvider();
string documentText = provider.Export(document);
int occurences = Regex.Matches(documentText, "sample").Count;

Hope this is helpful.

Regards,
Tanya
Progress Telerik

Tags
WordsProcessing
Asked by
Jyoti
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or