Skip to main content

SetStart

Specifies the starting value for the numbering used by the parent numbering level within a given numbering level definition. By default this value is 1.

Syntax

expression.SetStart(nStart);

expression - A variable that represents a ApiNumberingLevel class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nStartRequirednumberThe starting value for the numbering used by the parent numbering level.

Returns

boolean

Example

Set the starting counter value for a nested numbering level in a document.

// How do I make a child list begin at a specific number instead of one in a document?

// Offset a sub-list's first item to continue numbering from a chosen value in a document.

let doc = Api.GetDocument();
let numbering = doc.CreateNumbering("numbered");
let numLvl = numbering.GetLevel(0);
let numLvl1 = numbering.GetLevel(1);
numLvl1.SetStart(5);
let paragraph = doc.GetElement(0);
paragraph.SetNumbering(numLvl);
paragraph.AddText("This is the first element of a parent numbered list which starts with '1'");
paragraph = Api.CreateParagraph();
paragraph.SetNumbering(numLvl1);
paragraph.AddText("This is the first element of a child numbered list which starts with 'e'");
doc.Push(paragraph);