# GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Word_RangeBaseFindReplaceExtensions_Find_" data-uid="GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find*">Find Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Word_RangeBaseFindReplaceExtensions_Find_" data-uid="GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find*"></a>
<h4 id="GrapeCity_Documents_Word_RangeBaseFindReplaceExtensions_Find_GrapeCity_Documents_Word_RangeBase_System_String_GrapeCity_Documents_Word_FindOptions_" data-uid="GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find(GrapeCity.Documents.Word.RangeBase,System.String,GrapeCity.Documents.Word.FindOptions)">Find(RangeBase, string, FindOptions)</h4>
<div class="markdown level1 summary"><p>In the current range, finds all occurrences of a specified <code class="paramref">findPattern</code>,
using specified <code class="paramref">options</code>.</p>
<p>
The <code class="paramref">findPattern</code> can contain regular expressions 
(use <a class="xref" href="GrapeCity.Documents.Word.FindOptions.RegularExpressions.html#GrapeCity_Documents_Word_FindOptions_RegularExpressions">RegularExpressions</a> to control this).
</p>
<p>
The following special tokens can be used in the <code class="paramref">findPattern</code>
regardless of whether regex are on or off:
<ul><li><span class="term">&amp;p</span>end of paragraph</li><li><span class="term">&amp;l</span>manual line break</li><li><span class="term">&amp;m</span>page break</li><li><span class="term">&amp;b</span>section break</li></ul>

<p>
To search for text with certain formatting, use <code class="paramref">options</code>
and set the <a class="xref" href="GrapeCity.Documents.Word.FindOptions.FormattingOptions.html#GrapeCity_Documents_Word_FindOptions_FormattingOptions">FormattingOptions</a> on it accordingly.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IEnumerable&lt;FindResult&gt; Find(this RangeBase searchRange, string findPattern, FindOptions options = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Find(searchRange As RangeBase, findPattern As String, Optional options As FindOptions = Nothing) As IEnumerable(Of FindResult)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Word.RangeBase.html">RangeBase</a></td>
      <td><span class="parametername">searchRange</span></td>
      <td><p>The current range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">findPattern</span></td>
      <td><p>The search pattern. May contain regular expressions, or be an empty string.
<p>If empty, the search will be for any text with formatting that matches the <a class="xref" href="GrapeCity.Documents.Word.FindOptions.FormattingOptions.html#GrapeCity_Documents_Word_FindOptions_FormattingOptions">FormattingOptions</a>
passed in <code class="paramref">options</code>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Word.FindOptions.html">FindOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>The search and replace options.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="GrapeCity.Documents.Word.FindResult.html">FindResult</a>&gt;</td>
      <td><p>The list of found occurrences.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Word_RangeBaseFindReplaceExtensions_Find_" data-uid="GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find*"></a>
<h4 id="GrapeCity_Documents_Word_RangeBaseFindReplaceExtensions_Find_GrapeCity_Documents_Word_RangeBase_GrapeCity_Documents_Word_FindOptions_" data-uid="GrapeCity.Documents.Word.RangeBaseFindReplaceExtensions.Find(GrapeCity.Documents.Word.RangeBase,GrapeCity.Documents.Word.FindOptions)">Find(RangeBase, FindOptions)</h4>
<div class="markdown level1 summary"><p>In the current range, finds all occurrences of any text with formatting
specified by <a class="xref" href="GrapeCity.Documents.Word.FindOptions.FormattingOptions.html#GrapeCity_Documents_Word_FindOptions_FormattingOptions">FormattingOptions</a> set on
<code class="paramref">options</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IEnumerable&lt;FindResult&gt; Find(this RangeBase searchRange, FindOptions options)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Find(searchRange As RangeBase, options As FindOptions) As IEnumerable(Of FindResult)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Word.RangeBase.html">RangeBase</a></td>
      <td><span class="parametername">searchRange</span></td>
      <td><p>The current range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Word.FindOptions.html">FindOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>The search options.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="GrapeCity.Documents.Word.FindResult.html">FindResult</a>&gt;</td>
      <td><p>The list of found occurrences.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
