Get Started
Documentation

SetLabel

SetLabel(sLabel)

Set the label attribute for this container

Parameters:

Name Type Description
sLabel string

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oBlockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control with a label set to it.");
oBlockLvlSdt.SetLabel("2147483647");
oDocument.AddElement(0, oBlockLvlSdt);
oLabel = oBlockLvlSdt.GetLabel();
oParagraph = oDocument.GetElement(1);
oParagraph.AddText("Label: " + oLabel);
builder.SaveFile("docx", "SetLabel.docx");
builder.CloseFile();

Resulting document