Skip to main content

GetLevel

Returns the specified level of the current numbering.

Syntax

expression.GetLevel(nLevel);

expression - A variable that represents a ApiNumbering class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nLevelRequirednumberThe numbering level index. This value MUST BE from 0 to 8.

Returns

ApiNumberingLevel

Example

Get the specified level of the numbering in a document.

// How to find out the level of the bulleted paragraph in a document.

// Print the level of numbering of the text in a document.

let doc = Api.GetDocument();
let numbering = doc.CreateNumbering("bullet");
for (let nLvl = 0; nLvl < 8; ++nLvl) {
let numLvl = numbering.GetLevel(nLvl);
let paragraph = Api.CreateParagraph();
paragraph.AddText("Default bullet lvl " + (nLvl + 1));
paragraph.SetNumbering(numLvl);
paragraph.SetContextualSpacing(true);
doc.Push(paragraph);
}