Get Started
Usage API
More information

SetAlias

SetAlias(sAlias)

Set the alias attribute for this container.

Parameters:

Name Type Description
sAlias string

The alias which will be added to the current inline text content control.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oInlineLvlSdt = Api.CreateInlineLvlSdt();
oRun = Api.CreateRun();
oRun.AddText("This is an inline text content control with alias '№1'.");
oInlineLvlSdt.AddElement(oRun, 0);
oInlineLvlSdt.SetAlias("№1");
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
builder.SaveFile("docx", "SetAlias.docx");
builder.CloseFile();

Resulting document