Get Started
Documentation

SetTemplateType

SetTemplateType(sType, sSymbolopt)

Set one of the existing predefined numbering templates.

Parameters:

Name Type Attributes Default Description
sType "none" | "bullet" | "1)" | "1." | "I." | "A." | "a)" | "a." | "i."
The numbering type used for the current numbering definition.
sSymbol string <optional>
"" The symbol used for the list numbering. This parameter have a meaning only if the sType="bullet" property is selected.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oNumLvl, oNumbering;
oNumbering = oDocument.CreateNumbering("numbered");
oNumLvl = oNumbering.GetLevel(0);
oNumLvl.SetTemplateType("A.");
oParagraph = oDocument.GetElement(0);
oParagraph.SetNumbering(oNumLvl);
oParagraph.AddText("This is the first element of an A.-B.-C. numbered list");
oParagraph = Api.CreateParagraph();
oParagraph.SetNumbering(oNumLvl);
oParagraph.AddText("This is the second element of an A.-B.-C. numbered list");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.SetNumbering(oNumLvl);
oParagraph.AddText("This is the third element of an A.-B.-C. numbered list");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SetTemplateType.docx");
builder.CloseFile();

Resulting document