HeadingStyles Property

Applies To

TableOfContents object, TableOfFigures object.

Description

Returns a HeadingStyles object that represents additional styles used to compile a table of contents or table of figures (styles other than the Heading 1 – Heading 9 styles). Read-only.

See Also

Add method (HeadingStyles collection), UseHeadingStyles property.

Example

This example adds a style to the HeadingStyles collection and then displays the names of all the style in the collection.

If ActiveDocument.TablesOfContents.Count >=1 Then
    ActiveDocument.TablesOfContents(1).HeadingStyles.Add _
        Style:="Title", Level:=2
    For Each hStyle In ActiveDocument.TablesOfContents(1).HeadingStyles
        MsgBox hStyle.Style
    Next hStyle
End If
This example adds a style named "Blue" to the HeadingStyles collection in a table of contents for Sales.doc.

With Documents("Sales.doc")
    .Styles.Add Name:="Blue"
    .TablesOfContents(1).UseHeadingStyles = True
    .TablesOfContents(1).HeadingStyles.Add Style:="Blue", Level:=4
End With