Class TableOfFigures (Word VBA)

The class TableOfFigures represents a single table of figures in a document. The TableOfFigures object is a member of the TablesOfFigures collection. The TablesOfFigures collection includes all the tables of figures in a document.

The main procedures of class TableOfFigures are Delete and TablesOfFigures.Add

Set

To use a TableOfFigures class variable it first needs to be instantiated, for example

Dim tofs as TableOfFigures
Set tofs = ActiveDocument.TablesOfFigures(Index:=1)

The following procedures can be used to set variables of type TableOfFigures: TablesOfFigures.Add, TablesOfFigures.Item and Document.TablesOfFigures

For Each

Here is an example of processing the TableOfFigures items in a collection.

Dim tof As TableOfFigures 
For Each tof In Documents("Sales.docx").TablesOfFigures 
 tof.UpdatePageNumbers 
Next tof

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Page with its procedures IncludePageNumbers, RightAlignPageNumbers and UpdatePageNumbers

Methods

These are the main methods of the TableOfFigures class

Delete - Deletes the specified table of figures.

ActiveDocument.TablesOfFigures(1).Delete

TablesOfFigures.Add - Returns a TableOfFigures object that represents a table of figures added to a document.

Dim tofs As TableOfFigures
Set tofs = ActiveDocument.TablesOfFigures.Add(Range:=)

Other Methods

TablesOfFigures.MarkEntry - Inserts a TC (Table of Contents Entry) field after the specified range. The method returns a Field object representing the TC field.

Dim fldMarkEntry As Field
Set fldMarkEntry = ActiveDocument.TablesOfFigures.MarkEntry(Range:=)

Properties

Caption returns or sets the label that identifies the items to be included in a table of figures.

ActiveDocument.TablesOfFigures(1).Caption =

HeadingStyles 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).

Dim hssHeadingStyles As HeadingStyles
Set hssHeadingStyles = ActiveDocument.TablesOfFigures(1).HeadingStyles

HidePageNumbersInWeb returns or sets whether page numbers in a table of contents or a table of figures should be hidden when publishing to the Web.

ActiveDocument.TablesOfFigures(1).HidePageNumbersInWeb = True

IncludeLabel true if the caption label and caption number are included in a table of figures.

ActiveDocument.TablesOfFigures(1).IncludeLabel = True

LowerHeadingLevel returns or sets the ending heading level for a table of figures.

ActiveDocument.TablesOfFigures(1).LowerHeadingLevel =

Parent returns an object that represents the parent object of the specified TableOfFigures object.

Dim objParent As Object
Set objParent = ActiveDocument.TablesOfFigures(1).Parent

Range returns a Range object that represents the portion of a document that is contained within the specified table of figures.

Dim rngRange As Range
Set rngRange = ActiveDocument.TablesOfFigures(1).Range

TabLeader returns or sets the character between entries and their page numbers in an table of figures.

ActiveDocument.TablesOfFigures(1).TabLeader = wdTabLeaderDashes

TableID returns or sets a one-letter identifier that is used to build a table of figures from TOC fields.

ActiveDocument.TablesOfFigures(1).TableID =

UpperHeadingLevel returns or sets the starting heading level for a table of figures.

ActiveDocument.TablesOfFigures(1).UpperHeadingLevel =

UseFields true if Table of Contents Entry (TC) fields are used to create a table of figures.

ActiveDocument.TablesOfFigures(1).UseFields = True

UseHeadingStyles true if built-in heading styles are used to create a table of figures.

ActiveDocument.TablesOfFigures(1).UseHeadingStyles = True

UseHyperlinks returns or sets whether entries in a table of figures should be formatted as hyperlinks when publishing to the Web.

ActiveDocument.TablesOfFigures(1).UseHyperlinks = True

TablesOfFigures.Count returns a Long that represents the number of tables of figures in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.TablesOfFigures.Count

TablesOfFigures.Format returns or sets the formatting for the tables of figures in the specified document.

ActiveDocument.TablesOfFigures.Format = wdTOFCentered

TablesOfFigures.Parent returns an object that represents the parent object of the specified TablesOfFigures object.

Dim objParent As Object
Set objParent = ActiveDocument.TablesOfFigures.Parent