UseHeadingStyles Property 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

This example adds a table of figures in place of the selection and then formats the table to compile entries from TC fields.

With ActiveDocument.TablesOfFigures.Add(Range:=Selection.Range)
    .UseHeadingStyles = False
    .UseFields = True
End With