InsertInContentControl

function InsertInContentControl(nType: number = null): ApiParagraph | ApiBlockLvlSdt

Description

Wraps the paragraph object with a rich text content control.

Parameters

nTypenumberdefault: 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);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).