跳到主要内容

获取选区类型

返回当前选区的类型。

语法

expression.GetSelectionType();

expression - 表示一个 Api 类的变量。

参数

此方法无参数。

返回值

选区类型

示例

window.Asc.plugin.executeMethod ("GetSelectionType", [], function(type) {
switch (type) {
case "none":
case "drawing":
window.Asc.plugin.executeMethod ("PasteText", [$("#txt_shower")[0].innerText], function (result) {
paste_done = true;
});
break;
case "text":
window.Asc.plugin.callCommand (function() {
Api.ReplaceTextSmart (Asc.scope.arr);
}, undefined, undefined, function(result) {
paste_done = true;
});
break;
}
});