[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find

Find Method

Find(RangeBase, string, FindOptions)

In the current range, finds all occurrences of a specified findPattern, using specified options.

The findPattern can contain regular expressions (use RegularExpressions to control this).

The following special tokens can be used in the findPattern regardless of whether regex are on or off:

  • &pend of paragraph
  • &lmanual line break
  • &mpage break
  • &bsection break

To search for text with certain formatting, use options and set the FormattingOptions on it accordingly.

Declaration
public static IEnumerable<FindResult> Find(this RangeBase searchRange, string findPattern, FindOptions options = null)
Public Shared Function Find(searchRange As RangeBase, findPattern As String, Optional options As FindOptions = Nothing) As IEnumerable(Of FindResult)
Parameters
Type Name Description
RangeBase searchRange

The current range.

string findPattern

The search pattern. May contain regular expressions, or be an empty string.

If empty, the search will be for any text with formatting that matches the FormattingOptions passed in options.

FindOptions options

The search and replace options.

Returns
Type Description
IEnumerable<FindResult>

The list of found occurrences.