Compartilhar via


TableOfContents.TableID Property

Word Developer Reference

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.

Visual Basic for Applications
  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