TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

Asc.scope object

Description

The object is used to pass any additional data (objects, parameters, variables, etc.) to the window.Asc.plugin.callCommand method, which is executed in its own isolated context.

The functions cannot be passed to the callCommand method using the Asc.scope object.
Example
(function(window, undefined){
    var scopeText = ["Hello World!", "This is me!", "I'm glad to see you!!!"];
    window.Asc.plugin.init = function() {
        Asc.scope.st = scopeText;
        this.callCommand(function() {
            var oDocument = Api.GetDocument();
            var oParagraph = Api.CreateParagraph();
            for (var i = 0; i < Asc.scope.st.length; i++)
            {
                oParagraph.AddText(Asc.scope.st[i] + "<br />");
            }
            oDocument.InsertContent([oParagraph]);
        }, true);
    };
    window.Asc.plugin.button = function(id)
    {
    };
})(window, undefined);