window.Asc.plugin.attachEvent('onContextMenuShow', function(options) { if (!options) return; if (options.type === 'Selection' || options.type === 'Target') this.executeMethod('AddContextMenuItem', [getContextMenuItems()]); });