<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharSet="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>ITableOfContentsOptions | docx</title><metaname="description"content="Documentation for docx"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="../assets/style.css"/><linkrel="stylesheet"href="../assets/highlight.css"/><scriptdefersrc="../assets/main.js"></script><scriptasyncsrc="../assets/search.js"id="tsd-search-script"></script><scriptasyncsrc="../assets/navigation.js"id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme=localStorage.getItem("tsd-theme")||"os"</script><headerclass="tsd-page-toolbar"><divclass="tsd-toolbar-contents container"><divclass="table-cell"id="tsd-search"data-base=".."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget tsd-toolbar-icon search no-caption"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="#icon-search"></use></svg></label><inputtype="text"id="tsd-search-field"aria-label="Search"/></div><divclass="field"><divid="tsd-toolbar-links"></div></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="../index.html"class="title">docx</a></div><divclass="table-cell"id="tsd-widgets"><ahref="#"class="tsd-widget tsd-toolbar-icon menu no-caption"data-toggle="menu"aria-label="Menu"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="#icon-menu"></use></svg></a></div></div></header><divclass="container container-main"><divclass="col-content"><divclass="tsd-page-title"><ulclass="tsd-breadcrumb"><li><ahref="../modules.html">docx</a></li><li><ahref="ITableOfContentsOptions.html">ITableOfContentsOptions</a></li></ul><h1>Interface ITableOfContentsOptions</h1></div><sectionclass="tsd-panel tsd-comment"><divclass="tsd-comment tsd-typography"><p>Options according to this docs:
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L25">file/table-of-contents/table-of-contents-properties.ts:25</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="captionLabelIncludingNumbers"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>caption<wbr/>Label<wbr/>Including<wbr/>Numbers</span><ahref="#captionLabelIncludingNumbers"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">caption<wbr/>Label<wbr/>Including<wbr/>Numbers</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\c option - Includes figures, tables, charts, and other items that are numbered
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L39">file/table-of-contents/table-of-contents-properties.ts:39</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="entriesFromBookmark"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>entries<wbr/>From<wbr/>Bookmark</span><ahref="#entriesFromBookmark"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">entries<wbr/>From<wbr/>Bookmark</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\b option - Includes entries only from the portion of the document marked by
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L31">file/table-of-contents/table-of-contents-properties.ts:31</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="entryAndPageNumberSeparator"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>entry<wbr/>And<wbr/>Page<wbr/>Number<wbr/>Separator</span><ahref="#entryAndPageNumberSeparator"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">entry<wbr/>And<wbr/>Page<wbr/>Number<wbr/>Separator</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\p option - Text in this switch's field-argument specifies a sequence of characters
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L86">file/table-of-contents/table-of-contents-properties.ts:86</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="headingStyleRange"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>heading<wbr/>Style<wbr/>Range</span><ahref="#headingStyleRange"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">heading<wbr/>Style<wbr/>Range</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\o option - Uses paragraphs formatted with all or the specified range of builtin
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L80">file/table-of-contents/table-of-contents-properties.ts:80</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="hideTabAndPageNumbersInWebView"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>hide<wbr/>Tab<wbr/>And<wbr/>Page<wbr/>Numbers<wbr/>In<wbr/>Web<wbr/>View</span><ahref="#hideTabAndPageNumbersInWebView"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">hide<wbr/>Tab<wbr/>And<wbr/>Page<wbr/>Numbers<wbr/>In<wbr/>Web<wbr/>View</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">boolean</span></div><divclass="tsd-comment tsd-typography"><p>\z Hides tab leader and page numbers in web page view (§17.18.102).</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L121">file/table-of-contents/table-of-contents-properties.ts:121</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="hyperlink"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>hyperlink</span><ahref="#hyperlink"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">hyperlink</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">boolean</span></div><divclass="tsd-comment tsd-typography"><p>\h option - Makes the table of contents entries hyperlinks.</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L56">file/table-of-contents/table-of-contents-properties.ts:56</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="pageNumbersEntryLevelsRange"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>page<wbr/>Numbers<wbr/>Entry<wbr/>Levels<wbr/>Range</span><ahref="#pageNumbersEntryLevelsRange"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">page<wbr/>Numbers<wbr/>Entry<wbr/>Levels<wbr/>Range</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\n option - Without field-argument, omits page numbers from the table of contents.
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L71">file/table-of-contents/table-of-contents-properties.ts:71</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="preserveNewLineInEntries"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>preserve<wbr/>New<wbr/>Line<wbr/>In<wbr/>Entries</span><ahref="#preserveNewLineInEntries"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">preserve<wbr/>New<wbr/>Line<wbr/>In<wbr/>Entries</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">boolean</span></div><divclass="tsd-comment tsd-typography"><p>\x Preserves newline characters within table entries.</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L116">file/table-of-contents/table-of-contents-properties.ts:116</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="preserveTabInEntries"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>preserve<wbr/>Tab<wbr/>In<wbr/>Entries</span><ahref="#preserveTabInEntries"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">preserve<wbr/>Tab<wbr/>In<wbr/>Entries</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">boolean</span></div><divclass="tsd-comment tsd-typography"><p>\w Preserves tab entries within table entries.</p>
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L111">file/table-of-contents/table-of-contents-properties.ts:111</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="seqFieldIdentifierForPrefix"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>seq<wbr/>Field<wbr/>Identifier<wbr/>For<wbr/>Prefix</span><ahref="#seqFieldIdentifierForPrefix"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">seq<wbr/>Field<wbr/>Identifier<wbr/>For<wbr/>Prefix</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\s option - For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number.
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L93">file/table-of-contents/table-of-contents-properties.ts:93</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="sequenceAndPageNumbersSeparator"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>sequence<wbr/>And<wbr/>Page<wbr/>Numbers<wbr/>Separator</span><ahref="#sequenceAndPageNumbersSeparator"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">sequence<wbr/>And<wbr/>Page<wbr/>Numbers<wbr/>Separator</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\d option - When used with \s, the text in this switch's field-argument defines
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L45">file/table-of-contents/table-of-contents-properties.ts:45</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="stylesWithLevels"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>styles<wbr/>With<wbr/>Levels</span><ahref="#stylesWithLevels"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">styles<wbr/>With<wbr/>Levels</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-keyword">readonly </span><ahref="../classes/StyleLevel.html"class="tsd-signature-type tsd-kind-class">StyleLevel</a><spanclass="tsd-signature-symbol">[]</span></div><divclass="tsd-comment tsd-typography"><p>\t field-argument Uses paragraphs formatted with styles other than the built-in heading styles.
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L101">file/table-of-contents/table-of-contents-properties.ts:101</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="tcFieldIdentifier"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>tc<wbr/>Field<wbr/>Identifier</span><ahref="#tcFieldIdentifier"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">tc<wbr/>Field<wbr/>Identifier</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\f option - Includes only those TC fields whose identifier exactly matches the
</div><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/dolanmiu/docx/blob/0434d00/src/file/table-of-contents/table-of-contents-properties.ts#L51">file/table-of-contents/table-of-contents-properties.ts:51</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><aid="tcFieldLevelRange"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag ts-flagOptional">Optional</code><codeclass="tsd-tag ts-flagReadonly">Readonly</code><span>tc<wbr/>Field<wbr/>Level<wbr/>Range</span><ahref="#tcFieldLevelRange"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">tc<wbr/>Field<wbr/>Level<wbr/>Range</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">string</span></div><divclass="tsd-comment tsd-typography"><p>\l option - Includes TC fields that assign entries to one of the levels specified