Partager via


TableOfContents.TableID Property (Word)

Returns or sets a one-letter identifier that's used to build a table of contents from TOC fields. Read/write String.

Syntax

expression .TableID

expression Required. A variable that represents a TableOfContents collection.

Remarks

This property corresponds to the \f switch for a TOC field. For example, "T" builds a table of contents from TOC fields using the table identifier T.

Example

This example inserts a TOC field with an "A" identifier after the selection in Sales.doc. The first table of contents is then formatted to compile "A" entries.

Documents("Sales.doc").TablesOfContents.MarkEntry _ 
 Range:=Selection.Range, _ 
 Entry:="Hello", TableID:="A" 
With Documents("Sales.doc").TablesOfContents(1) 
 .TableID = "A" 
 .UseFields = True 
 .UseHeadingStyles = False 
 .Update 
End With

See Also

Concepts

TableOfContents Object

TableOfContents Object Members