TableOfContents.UseHeadingStyles property (Word)
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.
If ActiveDocument.TablesOfContents.Count >= 1 Then
With ActiveDocument.TablesOfContents(1)
.UseHeadingStyles = True
.UseFields = False
.UpperHeadingLevel = 1
.LowerHeadingLevel = 3
End With
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.