Get Started
Documentation

GetAlias

GetAlias() → { string }

Get the alias attribute for this container

Parameters:

This method doesn't have any parameters.

Returns:

Type
string

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);
oAlias = oInlineLvlSdt.GetAlias();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Alias: " + oAlias);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetAlias.docx");
builder.CloseFile();

Resulting document