Get Started
Usage API
More information

UpdateAllTOC

UpdateAllTOC([bOnlyPageNumbers])

Updates all tables of contents in the current document.

Parameters:

Name Type Default Description
bOnlyPageNumbers boolean false

Specifies that only page numbers will be updated.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
oDocument.UpdateAllTOC(true);
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Apply this script to the document with tables of contents and all of them will be updated.");
builder.SaveFile("docx", "UpdateAllTOC.docx");
builder.CloseFile();

Resulting document