Get Started
Documentation

SetLabel

SetLabel(sLabel)

Add a string label to the current inline text content control.

Parameters:

Name Type Description
sLabel string

The label which will be added to the current inline text content control. Can be a positive or negative integer from -2147483647 to 2147483647.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oInlineLvlSdt = Api.CreateInlineLvlSdt();
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
oRun = Api.CreateRun();
oRun.AddText("This is an inline text content control with a label set to it.");
oInlineLvlSdt.SetLabel("2147483647");
oInlineLvlSdt.AddElement(oRun, 0);
builder.SaveFile("docx", "SetLabel.docx");
builder.CloseFile();

Resulting document