New to Telerik Document ProcessingStart a free 30-day trial

Table of Contents Field

Updated on Feb 24, 2026

The TOC (Table of Contents) field creates a table of contents. It is created from the heading or other styles used in the document. You can specify the items by using the TC field as well.

In order to update the PageRef fields within the TOC field you need to set the FlowExtensibilityManager.NumberingFieldsProvider

Syntax

Syntax
{ TOC [Switches ] }

Switches

Switches that control whats included in the table of contents.

SwitchDescription
\o "Levels"Builds a table of contents from paragraphs formatted with styles that include outline levels (most commonly, heading styles). For example, { TOC \o "1-3" } lists only paragraphs formatted with styles that include outline levels 1 through 3
\t "Style,Level,Style,Level,..."Builds a table of contents from paragraphs formatted with styles other than the built-in styles. For example, { TOC \t "style1,1, style2,2" }
\uBuilds a table of contents from paragraphs whose formatting includes outline levels applied directly, in paragraph settings.
\c "SEQIdentifier"Lists figures, tables, charts, or other items that are numbered by a SEQ (Sequence) field.
\a IdentifierLists items captioned with the Caption but omits caption labels and numbers. Currently you can insert caption by adding a SEQ field
\f EntryIdentifierBuilds a table from TC fields. If EntryIdentifier is specified, the table is built only from TC fields with the same identifier (typically a letter)
\l LevelsBuilds a table of contents from TC fields that assign entries to one of the specified levels.
\b BookmarkNameCollects entries only from the portion of the document marked by the specified bookmark.

Switches that format the page number

SwitchDescription
\s IdentifierIncludes a number such as a chapter number before the page number. The chapter or other item must be numbered with a SEQ field. Identifier must match the identifier in the SEQ field.
\d "Separator"When used with the \s switch, specifies the character that separates the sequence numbers and page numbers.
\p "Separator"Specifies the character that separates an entry and its page number.
\n LevelsOmits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified.

Switches that format table entries

SwitchDescription
\wPreserves tab entries within table entries.
\xPreserves manual line breaks within table entries.
\zHides tab leader and page numbers in Web layout view.
\h HyperlinksInserts TOC entries as hyperlinks.

Inserting

Inserting this field is easily achieved through the RadFlowDocumentEditor's InsertField() method. It accepts code as argument.

Example 1 demonstrates how you can insert a TOC field.

Example 1: Insert TOC field

C#
    var document = new RadFlowDocument();
    var editor = new RadFlowDocumentEditor(document);

    editor.InsertField("TOC \\f a ");

This makes a list of all TC fields with the 'a' identifier.

See Also