executeMethod

executeMethod(name, params, callback) → { boolean }

Defines the method used to execute certain editor methods using the plugin.

The callback is the result that the method returns. It is an optional parameter. In case it is missing, the window.Asc.plugin.onMethodReturn function will be used to return the result of the method execution.

Parameters:

Name Type Description
name string

The name of the specific method that must be executed.

params Array

The arguments that the method in use has (if it has any).

callback function

The result that the method returns.

Returns:

Type
boolean

Example

Copy code
var arrDocuments = [{
    "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", [arrDocuments]);