window.Asc.plugin.info.editorType read-only

Description

Returns the type of the editor where the plugin is currently running.

The values are the following:

  • "word" - the text document editor;
  • "cell" - the spreadsheet document editor;
  • "slide" - the presentation document editor.
Returns

Type string

Example
function createScriptFromArray (aSelected) {
    var sScript = '';
    if (aSelected.length > 0) {
        switch (window.Asc.plugin.info.editorType) {
            case 'word': {
                sScript += 'var oDocument = Api.GetDocument();';
                sScript += '\noDocument.CreateNewHistoryPoint();';
                sScript += '\nvar oParagraph, oRun, arrInsertResult = [], oImage;';
                sScript += '\noDocument.InsertContent(arrInsertResult);';
                break;
            }
        }
    }
    return sScript;
}