跳到主要内容

GetClassType

返回 ApiRange 类的类型。

语法

expression.GetClassType();

expression - 表示 ApiRange 类的变量。

参数

此方法没有任何参数。

返回值

"range"

示例

检查范围返回的类类型。

// How do I check what type a range object is?

// Retrieve and output the class type string for a range.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = paragraph.GetRange(0, 9);
let classType = range.GetClassType();
paragraph = Api.CreateParagraph();
paragraph.AddText("Class type: " + classType);
doc.Push(paragraph);