Get Started
Plugins
Macros
More information

Methods

Description

window.Asc.plugin defines the object created when the plugin is launched. It has several methods some of which are optional and must be used only if and when needed.

Methods and properties
Name Description Type Presence
callCommand Defines the method used to send the data back to the editor. It replaces the executeCommand method when working with texts in order to simplify the syntax of the script that is necessary to pass to the editors. function required
callModule Defines the method used to execute a remotely located script following a link. function optional
createInputHelper Defines the method used to create an input helper. function optional
executeCommand Defines the method used to send the data back to the editor. Now this method is mainly used to work with the OLE objects and is retained for using with text so that the previous versions of the plugin remain compatible. function required
executeMethod Defines the method used to execute certain editor methods with the help of the plugin. function optional
getInputHelper Defines the method used to get the InputHelper object. function optional
loadModule Defines the method used to load a remotely located text resource. function optional
resizeWindow Defines the method used to change the window size updating the minimum/maximum sizes. function optional
Example
(function(window, undefined){
    var text = "Hello world!";
    window.Asc.plugin.init = function() {
        Asc.scope.text = text;
        this.callCommand(function() {
            var oDocument = Api.GetDocument();
            var oParagraph = Api.CreateParagraph();
            oParagraph.AddText(Asc.scope.text);
            oDocument.InsertContent([oParagraph]);
        }, true);
    };
    window.Asc.plugin.button = function(id)
    {
    };
})(window, undefined);