Skip to main content

InsertInContentControl

Wraps the paragraph object with a rich text content control.

Syntax

expression.InsertInContentControl(nType);

expression - A variable that represents a ApiParagraph class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nTypeRequirednumberDefines if this method returns the ApiBlockLvlSdt (nType === 1) or ApiParagraph (any value except 1) object.

Returns

ApiParagraph | ApiBlockLvlSdt

Example

This example wraps the paragraph object with a rich text content control.

let doc = Api.GetDocument();
let paragraph = Api.CreateParagraph();
paragraph.AddText("This is a paragraph inserted into the content control.");
let blockLvlSdt = paragraph.InsertInContentControl(1);
doc.AddElement(0, blockLvlSdt);