InsertInContentControl
function InsertInContentControl(nType: number = null): ApiParagraph | ApiBlockLvlSdt
Description
Wraps the paragraph object with a rich text content control.
Parameters
- nType
number
null Defines if this method returns the ApiBlockLvlSdt (nType === 1) or ApiParagraph (any value except 1) object.
Returns
ApiParagraph | ApiBlockLvlSdt
Try It
var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a paragraph inserted into the content control.");
var oBlockLvlSdt = oParagraph.InsertInContentControl(1);
oDocument.AddElement(0, oBlockLvlSdt);