Skip to main content

InsertAndReplaceContentControls

Inserts the content control containing data.

The data is specified by the JS code for Document Builder, or by a link to the shared document.

Syntax​

expression.InsertAndReplaceContentControls(arrDocuments);

expression - A variable that represents an Api class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
arrDocumentsRequiredContentControlPropertiesAndContent[]An array of properties and contents of the content control.

Returns​

ContentControlProperties[]

Example​

let documents = [{
"Props": {
"Id": 100,
"Tag": "CC_Tag",
"Lock": 3
},
"Script": "var oParagraph = Api.CreateParagraph();oParagraph.AddText('Hello world!');Api.GetDocument().InsertContent([oParagraph]);"
}];
window.Asc.plugin.executeMethod ("InsertAndReplaceContentControls", [documents]);