WordTableOfContent
OfficeIMO.Word
Represents a table of contents within a Word document.
Inheritance
- WordElement
- WordTableOfContent
Usage
Explore 4 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 4
Constructors
public WordTableOfContent(WordDocument wordDocument, WordTableOfContentsStyle tableOfContentStyle, int minLevel = 1, int maxLevel = 3) #Initializes a new instance of the WordTableOfContent class and appends it to the document body.
Parameters
- wordDocument OfficeIMO.Word.WordDocument
- Parent document where the table of contents will be created.
- tableOfContentStyle OfficeIMO.Word.WordTableOfContentsStyle
- Template style used to generate the table of contents.
- minLevel int = 1
- Minimum heading level to include (1..9).
- maxLevel int = 3
- Maximum heading level to include (1..9).
Methods
public WordCaptionListRefreshReport RefreshCaptionList(string sequenceIdentifier, string? title = null) #Regenerates visible list entries from generated caption paragraphs that contain a matching SEQ field.
Parameters
- sequenceIdentifier string
- Caption sequence identifier, for example Figure or Table.
- title string? = null
- Optional title shown above the generated list.
public WordTableOfContentRefreshReport RefreshEntries() #Regenerates visible table-of-contents entries from body heading paragraphs.
Returns
WordTableOfContentRefreshReport A report describing the generated entries and skipped headings.public WordIndexRefreshReport RefreshIndex(string? title = null) #Regenerates visible index entries from XE fields that OfficeIMO can evaluate deterministically.
Parameters
- title string? = null
- Optional title shown above the generated index.
public WordIndexRefreshReport RefreshIndex(string? title, string? entryType) #Regenerates visible index entries from XE fields matching the requested entry type.
Parameters
- title string?
- Optional title shown above the generated index.
- entryType string?
- Optional Word index entry type from XE \f switches. Pass null to include all entry types.
public WordIndexRefreshReport RefreshIndex(string? title, string? entryType, string? bookmarkName) #Regenerates visible index entries from body XE fields matching the requested entry type and bookmark scope.
Parameters
- title string?
- Optional title shown above the generated index.
- entryType string?
- Optional Word index entry type from XE \f switches. Pass null to include all entry types.
- bookmarkName string?
- Optional Word bookmark name from an INDEX \b switch. Pass null to scan the whole body.
public WordCaptionListRefreshReport RefreshListOfFigures() #Regenerates a generated list of figures from caption paragraphs that contain SEQ Figure fields.
public WordCaptionListRefreshReport RefreshListOfTables() #Regenerates a generated list of tables from caption paragraphs that contain SEQ Table fields.
public WordTableOfContent Regenerate() #Removes this table of contents and creates a new one in the same location.
public void Remove() #Deletes this table of contents from the parent document.
public void SetLevels(int minLevel, int maxLevel) #Updates the heading levels included by the TOC field switch (for example: \o "1-5").
Parameters
- minLevel int
- Minimum heading level to include (1..9).
- maxLevel int
- Maximum heading level to include (1..9).
public void Update() #Flags the document to update this table of contents when the file is opened.
Inherited Methods
Properties
public WordTableOfContentsStyle Style { get; } #Gets the template style used to create this table of contents.
public int MinLevel { get; } #Gets the minimum heading level included by the TOC field switch.
public int MaxLevel { get; } #Gets the maximum heading level included by the TOC field switch.
public string Text { get; set; } #Gets or sets the heading text displayed for the table of contents.
public WordParagraph? TitleParagraph { get; } #Gets the existing title paragraph, or null when this table of contents has no title.
public string TextNoContent { get; set; } #Gets or sets the text shown when the document has no entries for the table of contents.