# GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Word_Fields_IndexEntry_AddSubEntry_" data-uid="GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry*">AddSubEntry Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Word_Fields_IndexEntry_AddSubEntry_" data-uid="GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry*"></a>
<h4 id="GrapeCity_Documents_Word_Fields_IndexEntry_AddSubEntry_System_String_" data-uid="GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry(System.String)">AddSubEntry(string)</h4>
<div class="markdown level1 summary"><p>Adds a sub index entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IndexEntry AddSubEntry(string text)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddSubEntry(text As String) As IndexEntry</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>The sub index entry text.</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="GrapeCity.Documents.Word.Fields.IndexEntry.html">IndexEntry</a></td>
      <td><p>The sub index entry.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Thrown if adding a subentry that already exists.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Thrown if adding a subentry with <a class="xref" href="GrapeCity.Documents.Word.Fields.IndexEntry.Level.html#GrapeCity_Documents_Word_Fields_IndexEntry_Level">Level</a> greater than <a class="xref" href="GrapeCity.Documents.Word.OutlineLevel.html#GrapeCity_Documents_Word_OutlineLevel_Level9">Level9</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Word_Fields_IndexEntry_AddSubEntry_" data-uid="GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry*"></a>
<h4 id="GrapeCity_Documents_Word_Fields_IndexEntry_AddSubEntry_System_String_System_String_" data-uid="GrapeCity.Documents.Word.Fields.IndexEntry.AddSubEntry(System.String,System.String)">AddSubEntry(string, string)</h4>
<div class="markdown level1 summary"><p>Adds a sub index entry.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IndexEntry AddSubEntry(string text, string sortBy)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function AddSubEntry(text As String, sortBy As String) As IndexEntry</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>The sub index entry text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">sortBy</span></td>
      <td><p>The string to sort entry in the INDEX field result.</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="GrapeCity.Documents.Word.Fields.IndexEntry.html">IndexEntry</a></td>
      <td><p>The sub index entry.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Thrown if adding a subentry that already exists.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Thrown if adding a subentry with <a class="xref" href="GrapeCity.Documents.Word.Fields.IndexEntry.Level.html#GrapeCity_Documents_Word_Fields_IndexEntry_Level">Level</a> greater than <a class="xref" href="GrapeCity.Documents.Word.OutlineLevel.html#GrapeCity_Documents_Word_OutlineLevel_Level9">Level9</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
