window.Asc.plugin.init(data)

Description

The data sent to the plugin and what is to be done with it and how. This method is called when the plugin is started.

Parameters
Name Description Type
data The data parameter depends on the "initDataType" setting specified in the plugin configuration config.json file. It can be of the following type: "none" - an empty string, "text" - the selected document text, "html" - selected document fragment, "ole" - OLE object data. string
Example
window.Asc.plugin.init = function () {
    var sScript = 'var oDocument = Api.GetDocument();';
    sScript += 'oDocument.CreateNewHistoryPoint();';
    sScript += 'oParagraph = Api.CreateParagraph();';
    sScript += 'oParagraph.AddText(\'Hello word!\');';
    sScript += 'oDocument.InsertContent([oParagraph]);';
    window.Asc.plugin.info.recalculate = true;
    this.executeCommand("close", sScript);
};