TableOfContents.UpdatePageNumbers method (Word)

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

Syntax

expression. UpdatePageNumbers

expression Required. A variable that represents a 'TableOfContents' collection.

Example

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

See also

TableOfContents Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.