Get Started
Usage API

InsertInContentControl

InsertInContentControl(nType) → { ApiParagraph | ApiBlockLvlSdt }

Wraps the paragraph object with a rich text content control.

Parameters:

Name Type Description
nType number

if nType === 1 -> returns ApiBlockLvlSdt

Returns:

Type
ApiParagraph | ApiBlockLvlSdt

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a paragraph inserted into the content control.");
oBlockLvlSdt = oParagraph.InsertInContentControl(1);
oDocument.AddElement(0, oBlockLvlSdt);
builder.SaveFile("docx", "InsertInContentControl.docx");
builder.CloseFile();

Resulting document