TablesOfContents Property

Applies To

Document object.

Description

Returns a TablesOfContents collection that represents the tables of contents in the specified document. Read-only.

See Also

Add method (TablesOfContents collection), TablesOfFigures property.

Example

This example adds a table of contents at the beginning of Sales.doc. The table of contents collects entry text from TC fields.

Set myRange = Documents("Sales.doc").Range(Start:=0, End:=0)
Documents("Sales.doc").TablesOfContents.Add Range:=myRange, _
    UseFields:=True, UseHeadingStyles:=False
This example updates the page numbers for items in the table of contents in the active document.

For Each myTOC In ActiveDocument.TablesOfContents
    myTOC.UpdatePageNumbers
Next myTOC