Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("GetAllContentControls", callback)

Description

Defines the method that allows getting information about all the content controls that have been added to the page.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("GetAllContentControls");
Returns

The method returns an array of content control objects:

[
    {
        "Tag": "Document",
        "Id": 0,
        "Lock": 0,
        "InternalId": "1_713"
    }
]
Parameters
Parameter Description Type Example
Tag A tag assigned to the content control. The same tag can be assigned to several content controls so that it is possible to make reference to them in the code. string "{tag}"
Id A unique identifier of the content control. It can be used to search for a certain content control and make reference to it in the code. integer 2
Lock A value which defines if it is possible to delete and/or edit the content control or not. integer 0
InternalId A unique internal identifier of the content control. string "1_713"
Example
var flagInit = false;
window.Asc.plugin.init = function (text) {
    if (!flagInit) {
        this.executeMethod ("GetAllContentControls", null, function(data) {
            for (var i = 0; i < data.length; i++) {
                if (data[i].Tag == 11) {
                    this.Asc.plugin.executeMethod("SelectContentControl",[data[i].InternalId]);
                    break;
                }
            }
        });
        flagInit = true;
        ...
    }
};