Document.TablesOfContents (Word)

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

For information about returning a single member of a collection, see Returning an object from a collection.


Set myRange = Documents("Sales.doc").Range(Start:=0, End:=0) 
Documents("Sales.doc").TablesOfContents.Add Range:=myRange, _ 
 UseFields:=True, UseHeadingStyles:=False