We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





61563 May 29,2007 01:24 PM UTC May 30,2007 06:20 PM UTC ASP.NET Web Forms (Classic) 3
Tags: DocIO
Andy Tawse
Asked On May 29, 2007 01:24 PM UTC

I'm trying to search through a document using the FindAll method, but it either doesn't seem to find all instances of word (or none at all).


TextRangesHolder[] foundRanges = document.FindAll("phrase", false, false);

foreach (TextRangesHolder rangeHolder in foundRanges) {

foreach (TextRange range in rangeHolder) {
debug ++;

I'm not entirely sure what TextRangesHolder and TextRange are because the documentation is not very clear but in this example the document has 26 instances of "phrase" but FindAll only finds 16.

Is there something I'm doing wrong with FindAll? Or are there any obvious reasons why it might not find all instances of a word?

If TextRangesHolder holds many TextRanges why does FindAll return an array? I'm really quite confused about the TextRange stuff.

Thanks for any help you can give me.


Sarath Kumar G [Syncfusion]
Replied On May 30, 2007 12:30 AM UTC

Hi Andy,

Thank you for your interest in Syncfusion products.


TextRange is a collection of text, in other words it is the paragraph or the range text.


TextRangeHolder is a collection of TextRanges. The FindAll returns TextRangeHolder the collection of all text range that has the phrase that is given for replacement.

As per the code snippet provided by you, the number of instances of "phrase" depends on the occurrences of the phrase within a paragraph.(i.e., a paragraph might contain more than one instance of "phrase" which is considered a single occurrence. But, replacing is done to all the occurrences).

Here is the sample program for your reference.


Here is the generated document for your reference.


Please let me know if you face any issues.


Andy Tawse
Replied On May 30, 2007 09:46 AM UTC

Thanks for that. I think I understand TextRanges now but in the particular document I am searching, it still doesn't find *any* occurrences of a phrase that is definitely in it. My code should do that.

Could I send you through the document in question in private. I can't post it on a public forum.


Sarath Kumar G [Syncfusion]
Replied On May 30, 2007 06:20 PM UTC

Hi Andy,

Thank you for your continued interest in Syncfusion products.

Please create a Direct-Trac Incident with TITLE : [ Forum id (61563) - Title of Forum (document.FindAll) ]. You can post your sample document and code using which the issue is reproduced in that Incident. This will be more helpful for us to investigate further in this issue. Your sample document will be kept secured and will be used only for our internal Testing purpose.

Sorry for the inconvenience caused.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon