Get Started
Documentation

AddText

AddText(sText) → { bool }

Adds a text to the current content control.

Parameters:

Name Type Description
sText String

The text which will be add to the content control.

Returns:

Type
bool

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oBlockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
oDocument.AddElement(0, oBlockLvlSdt);
builder.SaveFile("docx", "AddText.docx");
builder.CloseFile();

Resulting document