Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("GetCurrentContentControlPr", [args], callback)

Description

Defines the method that allows getting current content control properties.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("GetCurrentContentControlPr", [contentFormat]);
Parameters
Parameter Description Type Example
contentFormat The content format ("none", "text", "html", "ole" or "desktop"). string "text"
Returns

The method returns the ContentControlProperties object containing the content control properties in the following form (JSON):

{
    "Id" : integer,
    "Tag" : string,
    "Lock" : integer,
    "InternalId" : string,
    "Alias" : string,
    "PlaceHolderText" : string,
    "Appearance" : integer,
    "Color" : {
        "R": integer,
        "G": integer,
        "B": integer
    }
}
Parameters
Parameter Description Type Example
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
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}"
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"
Alias The alias attribute. string "№1"
PlaceHolderText The content control placeholder text. string "placeholder text"
Appearance Defines if the content control is shown as the bounding box (1) or not (2). integer 1
Color The color for the current content control in the RGB format:
  • R - red color component value,
    type: integer,
    example: 0;
  • G - green color component value,
    type: integer,
    example: 0;
  • B - blue color component value,
    type: integer,
    example: 255;
object

The Lock parameter can have the following values:

Numeric value Edit Delete
0 No Yes
1 No No
2 Yes No
3 Yes Yes
Example
window.Asc.plugin.event_onClick = function(isSelectionUse) {
    window.Asc.plugin.executeMethod("GetCurrentContentControlPr", [], function(obj) {
        window.Asc.plugin.currentContentControl = obj;
        var controlTag = obj ? obj.Tag : "";
        if (isSelectionUse)
            controlTag = "";
        ... 
    }); 
};