Skip to main content

AddText

Adds a text to the current content control.

Syntax

expression.AddText(text);

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
textRequiredStringThe text which will be added to the content control.

Returns

boolean

Example

This example adds a text to the content control.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
doc.AddElement(0, blockLvlSdt);