SetAlias
Set the alias attribute for this container
Parameters:
Name |
Type |
Description |
sAlias |
string
|
|
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