Document Solutions for Word
DS.Documents.Word Assembly / GrapeCity.Documents.Word Namespace / RangeBaseFindReplaceExtensions Class / Find Method
The current range.
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 FindOptions.FormattingOptions passed in options.

The search and replace options.

In This Topic
    Find Method (RangeBaseFindReplaceExtensions)
    In This Topic
    In the current range, finds all occurrences of a specified findPattern, using specified options.

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

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

    • end of paragraph
    • manual line break
    • page break
    • section break

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

    Syntax
    'Declaration
     
    Public Shared Function Find( _
       ByVal searchRange As RangeBase, _
       ByVal findPattern As System.String, _
       Optional ByVal options As FindOptions _
    ) As System.Collections.Generic.IEnumerable(Of FindResult)
    public static System.Collections.Generic.IEnumerable<FindResult> Find( 
       RangeBase searchRange,
       System.string findPattern,
       FindOptions options
    )

    Parameters

    searchRange
    The current range.
    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 FindOptions.FormattingOptions passed in options.

    options
    The search and replace options.

    Return Value

    The list of found occurrences.
    See Also