# GrapeCity.Documents.Word.StyleCollection

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Word_StyleCollection" data-uid="GrapeCity.Documents.Word.StyleCollection" class="text-break">StyleCollection Class
</h1>
  <div class="markdown level0 summary"><p>Represents a collection of built-in and user-defined styles in a document.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">StyleCollection</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1">IReadOnlyList</a>&lt;<a class="xref" href="GrapeCity.Documents.Word.Style.html">Style</a>&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a class="xref" href="GrapeCity.Documents.Word.Style.html">Style</a>&gt;</div>
    <div><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.Style.html">Style</a>&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Word.html">GrapeCity.Documents.Word</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Word.dll</h6>
  <h5 id="GrapeCity_Documents_Word_StyleCollection_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class StyleCollection : IReadOnlyList&lt;Style&gt;, IReadOnlyCollection&lt;Style&gt;, IEnumerable&lt;Style&gt;, IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class StyleCollection
    Implements IReadOnlyList(Of Style), IReadOnlyCollection(Of Style), IEnumerable(Of Style), IEnumerable</code></pre>
  </div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Count" data-uid="GrapeCity.Documents.Word.StyleCollection.Count">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Count.html#GrapeCity_Documents_Word_StyleCollection_Count">Count</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the number of styles in the collection.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_DefaultFont" data-uid="GrapeCity.Documents.Word.StyleCollection.DefaultFont">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.DefaultFont.html#GrapeCity_Documents_Word_StyleCollection_DefaultFont">DefaultFont</a>
        </td>
        <td class="markdown level1 summary"><p>Gets document default text formatting.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_DefaultParagraphFormat" data-uid="GrapeCity.Documents.Word.StyleCollection.DefaultParagraphFormat">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.DefaultParagraphFormat.html#GrapeCity_Documents_Word_StyleCollection_DefaultParagraphFormat">DefaultParagraphFormat</a>
        </td>
        <td class="markdown level1 summary"><p>Gets document default paragraph formatting.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_DefaultTabStop" data-uid="GrapeCity.Documents.Word.StyleCollection.DefaultTabStop">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.DefaultTabStop.html#GrapeCity_Documents_Word_StyleCollection_DefaultTabStop">DefaultTabStop</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the interval (in points) between the default tab stops.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Document" data-uid="GrapeCity.Documents.Word.StyleCollection.Document">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Document.html#GrapeCity_Documents_Word_StyleCollection_Document">Document</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the parent document.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Item_GrapeCity_Documents_Word_BuiltInStyleId_" data-uid="GrapeCity.Documents.Word.StyleCollection.Item(GrapeCity.Documents.Word.BuiltInStyleId)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Item.html#GrapeCity_Documents_Word_StyleCollection_Item_GrapeCity_Documents_Word_BuiltInStyleId_">this[BuiltInStyleId]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a built-in style by its locale independent identifier.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Item_System_Int32_" data-uid="GrapeCity.Documents.Word.StyleCollection.Item(System.Int32)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Item.html#GrapeCity_Documents_Word_StyleCollection_Item_System_Int32_">this[int]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a style by its index.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Item_System_String_" data-uid="GrapeCity.Documents.Word.StyleCollection.Item(System.String)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Item.html#GrapeCity_Documents_Word_StyleCollection_Item_System_String_">this[string]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a style by name or alias.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Add_System_String_GrapeCity_Documents_Word_Style_" data-uid="GrapeCity.Documents.Word.StyleCollection.Add(System.String,GrapeCity.Documents.Word.Style)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Add.html#GrapeCity_Documents_Word_StyleCollection_Add_System_String_GrapeCity_Documents_Word_Style_">Add(string, Style)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new user defined style and adds it to the document.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Add_System_String_GrapeCity_Documents_Word_StyleType_" data-uid="GrapeCity.Documents.Word.StyleCollection.Add(System.String,GrapeCity.Documents.Word.StyleType)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Add.html#GrapeCity_Documents_Word_StyleCollection_Add_System_String_GrapeCity_Documents_Word_StyleType_">Add(string, StyleType)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new user defined style and adds it to the document.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_AddLinkedStyle_System_String_GrapeCity_Documents_Word_Style_" data-uid="GrapeCity.Documents.Word.StyleCollection.AddLinkedStyle(System.String,GrapeCity.Documents.Word.Style)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.AddLinkedStyle.html#GrapeCity_Documents_Word_StyleCollection_AddLinkedStyle_System_String_GrapeCity_Documents_Word_Style_">AddLinkedStyle(string, Style)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds a pair of linked paragraph and character styles to the collection.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_Contains_System_String_" data-uid="GrapeCity.Documents.Word.StyleCollection.Contains(System.String)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.Contains.html#GrapeCity_Documents_Word_StyleCollection_Contains_System_String_">Contains(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Checks whether this collection contains a style with a specified name.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_GetDefaultStyle_GrapeCity_Documents_Word_StyleType_" data-uid="GrapeCity.Documents.Word.StyleCollection.GetDefaultStyle(GrapeCity.Documents.Word.StyleType)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.GetDefaultStyle.html#GrapeCity_Documents_Word_StyleCollection_GetDefaultStyle_GrapeCity_Documents_Word_StyleType_">GetDefaultStyle(StyleType)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the style that is applied to objects that do not explicitly specify a style.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_SetDefaultStyle_GrapeCity_Documents_Word_StyleType_GrapeCity_Documents_Word_Style_" data-uid="GrapeCity.Documents.Word.StyleCollection.SetDefaultStyle(GrapeCity.Documents.Word.StyleType,GrapeCity.Documents.Word.Style)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.SetDefaultStyle.html#GrapeCity_Documents_Word_StyleCollection_SetDefaultStyle_GrapeCity_Documents_Word_StyleType_GrapeCity_Documents_Word_Style_">SetDefaultStyle(StyleType, Style)</a>
        </td>
        <td class="markdown level1 summary"><p>Sets the style that is applied to objects that do not explicitly specify a style.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Word_StyleCollection_TryGetValue_System_String_GrapeCity_Documents_Word_Style__" data-uid="GrapeCity.Documents.Word.StyleCollection.TryGetValue(System.String,GrapeCity.Documents.Word.Style@)">
          <a class="xref" href="GrapeCity.Documents.Word.StyleCollection.TryGetValue.html#GrapeCity_Documents_Word_StyleCollection_TryGetValue_System_String_GrapeCity_Documents_Word_Style__">TryGetValue(string, out Style)</a>
        </td>
        <td class="markdown level1 summary"><p>Tries to get a style from the collection by its name.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
