UpdatePageNumbers Method

Applies To

TableOfContents object, TableOfFigures object.

Description

Updates the page numbers for items in the specified table of contents or table of figures.

Syntax

expression.UpdatePageNumbers

expression Required. An expression that returns a TableOfContents or TableOfFigures object.

See Also

IncludePageNumbers property, Update method.

Example

This example updates all tables of figures in Sales.doc.

For Each figs In Documents("Sales.doc").TablesOfFigures
    figs.UpdatePageNumbers
Next figs
This example inserts a page break at the insertion point and then updates the page numbers for the first table of contents in the active document.

Selection.Collapse Direction:=wdCollapseStart
Selection.InsertBreak Type:=wdPageBreak
ActiveDocument.TablesOfContents(1).UpdatePageNumbers