Edit

Share via


Word.TableOfContentsAddOptions interface

Specifies the options for adding to a Word.TableOfContentsCollection object.

Remarks

[ API set: WordApiDesktop 1.4 ]

Properties

addedStyles

If provided, specifies the string names of additional styles to use for the table of contents. Use HeadingStyleCollection.add to create new heading styles.

hidePageNumbersOnWeb

If provided, specifies whether the page numbers in a table of contents should be hidden when publishing to the web. The default value is true.

includePageNumbers

If provided, specifies whether to include page numbers in a table of contents. The default value is true.

lowerHeadingLevel

If provided, specifies the ending heading level for a table of contents and must be a value from 1 to 9. Must be greater than upperHeadingLevel. Corresponds to the ending value used with the \o switch for a Table of Contents (TOC) field. The default value is 9.

rightAlignPageNumbers

If provided, specifies whether page numbers in a table of contents are aligned with the right margin. The default value is true.

tableId

If provided, specifies a one-letter identifier from TC fields that's used for a table of contents. Corresponds to the \f switch for a Table of Contents (TOC) field. For example, "T" indicates a table of contents includes TC fields that use the table identifier T. If this argument is omitted, TC fields aren't used.

upperHeadingLevel

If provided, specifies the starting heading level for a table of contents and must be a value from 1 to 9. Should be smaller than lowerHeadingLevel. Corresponds to the starting value used with the \o switch for a Table of Contents (TOC) field. The default value is 1.

useBuiltInHeadingStyles

If provided, specifies whether to use built-in heading styles to create a table of contents. The default value is true.

useFields

If provided, specifies whether Table of Contents Entry (TC) fields are used to create a table of contents. Use the TableOfContentsCollection.markTocEntry method to mark entries to be included in a table of contents. The default value is false.

useHyperlinksOnWeb

If provided, specifies whether entries in a table of contents should be formatted as hyperlinks when the document is published to the web. The default value is true.

useOutlineLevels

If provided, specifies whether to use outline levels to create a table of contents. The default value is false.

Property Details

addedStyles

If provided, specifies the string names of additional styles to use for the table of contents. Use HeadingStyleCollection.add to create new heading styles.

addedStyles?: string;

Property Value

string

Remarks

[ API set: WordApiDesktop 1.4 ]

hidePageNumbersOnWeb

If provided, specifies whether the page numbers in a table of contents should be hidden when publishing to the web. The default value is true.

hidePageNumbersOnWeb?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

includePageNumbers

If provided, specifies whether to include page numbers in a table of contents. The default value is true.

includePageNumbers?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

lowerHeadingLevel

If provided, specifies the ending heading level for a table of contents and must be a value from 1 to 9. Must be greater than upperHeadingLevel. Corresponds to the ending value used with the \o switch for a Table of Contents (TOC) field. The default value is 9.

lowerHeadingLevel?: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.4 ]

rightAlignPageNumbers

If provided, specifies whether page numbers in a table of contents are aligned with the right margin. The default value is true.

rightAlignPageNumbers?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

tableId

If provided, specifies a one-letter identifier from TC fields that's used for a table of contents. Corresponds to the \f switch for a Table of Contents (TOC) field. For example, "T" indicates a table of contents includes TC fields that use the table identifier T. If this argument is omitted, TC fields aren't used.

tableId?: string;

Property Value

string

Remarks

[ API set: WordApiDesktop 1.4 ]

upperHeadingLevel

If provided, specifies the starting heading level for a table of contents and must be a value from 1 to 9. Should be smaller than lowerHeadingLevel. Corresponds to the starting value used with the \o switch for a Table of Contents (TOC) field. The default value is 1.

upperHeadingLevel?: number;

Property Value

number

Remarks

[ API set: WordApiDesktop 1.4 ]

useBuiltInHeadingStyles

If provided, specifies whether to use built-in heading styles to create a table of contents. The default value is true.

useBuiltInHeadingStyles?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

useFields

If provided, specifies whether Table of Contents Entry (TC) fields are used to create a table of contents. Use the TableOfContentsCollection.markTocEntry method to mark entries to be included in a table of contents. The default value is false.

useFields?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

useHyperlinksOnWeb

If provided, specifies whether entries in a table of contents should be formatted as hyperlinks when the document is published to the web. The default value is true.

useHyperlinksOnWeb?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]

useOutlineLevels

If provided, specifies whether to use outline levels to create a table of contents. The default value is false.

useOutlineLevels?: boolean;

Property Value

boolean

Remarks

[ API set: WordApiDesktop 1.4 ]