A TableOfContents object defines the position and the properties of a table of contents. A table of contents can be automatically genarated from the structure levels defined for each paragraph in the document. A document can contain multiple tables of contents consisting of paragraphs with different levels. All tables of contents in a document are available through a TableOfContentsCollection object. To generate a new table of contents the TableOfContentsCollection.Add method can be used.

Syntax

public class TableOfContents
Public Class TableOfContents

Introduced: X19.

Constructors

Constructor Description
TableOfContents Initializes a new instance of the TableOfContents class.

Methods

Method Description
Save Saves the text of the table of contents with the specified format.
ScrollTo Sets the current input position to the beginning of the table of contents and scrolls it into the visible part of the document.
Update Updates the content and the page numbers of the table of contents.

Properties

Property Description
DefaultHighlightColor Represents the default highlight color.
HasLinks Gets or sets a value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget.
HasPageNumbers Gets or sets a value specifying whether the table of contents contains page numbers.
HasRightAlignedPageNumbers Gets or sets a value specifying whether the page numbers in the table of contents are right-aligned.
HighlightColor Gets or sets the highlight color for the table of contents.
HighlightMode Gets or sets a value indicating how the text of the table of contents is highlighted.
ID Gets or sets an identifier.
Length Gets the number of characters which belong to the table of contents.
MaximumStructureLevel Gets or sets the maximum structure level for this table of contents.
MinimumStructureLevel Gets or sets the minimum structure level for this table of contents.
Name Gets or sets a name for the table of contents.
Number Gets the number of the table of contents in the text.
Start Gets the index (one-based) of the first character which belongs to the table of contents.
Text Gets the text of the table of contents.
Title Gets or sets a title for the table of contents.

Further Reading

Learn more about the TXTextControl.TableOfContents Class in the Text Control Blog: