更新指定目录或图表目录中项目的页码。
expression.UpdatePageNumbers
expression 必需。该表达式返回一个 TableOfContents 或 TableOfFigures 对象。
本示例更新 Sales.doc 文档中的所有图表目录。
Dim tofLoop As TableOfFigures
For Each tofLoop In Documents("Sales.doc").TablesOfFigures
tofLoop.UpdatePageNumbers
Next tofLoop
本示例在插入点位置插入分页符,然后更新活动文档中第一个目录的页码。
Selection.Collapse Direction:=wdCollapseStart
Selection.InsertBreak Type:=wdPageBreak
ActiveDocument.TablesOfContents(1).UpdatePageNumbers