API Reference

Class

WordTableOfContent

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents a table of contents within a Word document.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public WordTableOfContent(WordDocument wordDocument, WordTableOfContentsStyle tableOfContentStyle, Int32 minLevel = 1, Int32 maxLevel = 3) #

Initializes a new instance of the WordTableOfContent class and appends it to the document body.

Parameters

wordDocument OfficeIMO.Word.WordDocument requiredposition: 0
Parent document where the table of contents will be created.
tableOfContentStyle OfficeIMO.Word.WordTableOfContentsStyle requiredposition: 1
Template style used to generate the table of contents.
minLevel System.Int32 = 1 optionalposition: 2
Minimum heading level to include (1..9).
maxLevel System.Int32 = 3 optionalposition: 3
Maximum heading level to include (1..9).

Methods

public WordCaptionListRefreshReport RefreshCaptionList(String sequenceIdentifier, String title = null) #
Returns: WordCaptionListRefreshReport

Regenerates visible list entries from generated caption paragraphs that contain a matching SEQ field.

Parameters

sequenceIdentifier System.String requiredposition: 0
Caption sequence identifier, for example Figure or Table.
title System.String = null optionalposition: 1
Optional title shown above the generated list.

Returns

A report describing the generated caption-list entries.

public WordTableOfContentRefreshReport RefreshEntries() #
Returns: WordTableOfContentRefreshReport

Regenerates visible table-of-contents entries from body heading paragraphs.

Returns

A report describing the generated entries and skipped headings.

RefreshIndex 3 overloads
public WordIndexRefreshReport RefreshIndex(String title = null) #
Returns: WordIndexRefreshReport

Regenerates visible index entries from XE fields that OfficeIMO can evaluate deterministically.

Parameters

title System.String = null optionalposition: 0
Optional title shown above the generated index.

Returns

A report describing the generated index entries.

public WordIndexRefreshReport RefreshIndex(String title, String entryType) #
Returns: WordIndexRefreshReport

Regenerates visible index entries from XE fields matching the requested entry type.

Parameters

title System.String requiredposition: 0
Optional title shown above the generated index.
entryType System.String requiredposition: 1
Optional Word index entry type from XE \f switches. Pass null to include all entry types.

Returns

A report describing the generated index entries.

public WordIndexRefreshReport RefreshIndex(String title, String entryType, String bookmarkName) #
Returns: WordIndexRefreshReport

Regenerates visible index entries from body XE fields matching the requested entry type and bookmark scope.

Parameters

title System.String requiredposition: 0
Optional title shown above the generated index.
entryType System.String requiredposition: 1
Optional Word index entry type from XE \f switches. Pass null to include all entry types.
bookmarkName System.String requiredposition: 2
Optional Word bookmark name from an INDEX \b switch. Pass null to scan the whole body.

Returns

A report describing the generated index entries.

public WordCaptionListRefreshReport RefreshListOfFigures() #
Returns: WordCaptionListRefreshReport

Regenerates a generated list of figures from caption paragraphs that contain SEQ Figure fields.

Returns

A report describing the generated figure-list entries.

public WordCaptionListRefreshReport RefreshListOfTables() #
Returns: WordCaptionListRefreshReport

Regenerates a generated list of tables from caption paragraphs that contain SEQ Table fields.

Returns

A report describing the generated table-list entries.

public WordTableOfContent Regenerate() #
Returns: WordTableOfContent

Removes this table of contents and creates a new one in the same location.

Returns

The newly created WordTableOfContent instance.

public Void Remove() #
Returns: Void

Deletes this table of contents from the parent document.

public Void SetLevels(Int32 minLevel, Int32 maxLevel) #
Returns: Void

Updates the heading levels included by the TOC field switch (for example: \o "1-5").

Parameters

minLevel System.Int32 requiredposition: 0
Minimum heading level to include (1..9).
maxLevel System.Int32 requiredposition: 1
Maximum heading level to include (1..9).
public Void Update() #
Returns: Void

Flags the document to update this table of contents when the file is opened.

Properties

public WordTableOfContentsStyle Style { get; } #

Gets the template style used to create this table of contents.

public Int32 MinLevel { get; } #

Gets the minimum heading level included by the TOC field switch.

public Int32 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 String TextNoContent { get; set; } #

Gets or sets the text shown when the document has no entries for the table of contents.