TableOfContents.UseHeadingStyles Property

Word Developer Reference

True if built-in heading styles are used to create a table of contents. Read/write Boolean.

Syntax

expression.UseHeadingStyles

expression   Required. A variable that represents a TableOfContents collection.

Example

This example formats the first table of contents in the active document to compile entries formatted with the Heading 1, Heading 2, or Heading 3 style.

Visual Basic for Applications
  If ActiveDocument.TablesOfContents.Count >= 1 Then
    With ActiveDocument.TablesOfContents(1)
        .UseHeadingStyles = True
        .UseFields = False
        .UpperHeadingLevel = 1
        .LowerHeadingLevel = 3
    End With
End If

See Also