跳到主要内容

TocStyleLvl

Table of contents style levels.

Type

Object

Properties

NameTypeDescription
NamestringStyle name (for example, "Heading 1").
LvlnumberLevel which will be applied to the specified style in the table of contents.

Example

This example adds a table of contents which is generated from the specified styles to the document.

let tocStyleLvl = [{Name: "Heading 1", Lvl: 2}, {Name: "Heading 2", Lvl: 3}];
let tocPr = {"ShowPageNums": true, "RightAlgn": true, "LeaderType": "dot", "FormatAsLinks": true, "BuildFrom": {"StylesLvls": tocStyleLvl}, "TocStyle": "standard"};
doc.AddTableOfContents(tocPr);