跳到主要内容

GetClassType

返回 ApiHyperlink 类的类型。

语法

expression.GetClassType();

expression - 表示 ApiHyperlink 类的变量。

参数

此方法没有任何参数。

返回值

"hyperlink"

示例

此示例获取类类型并将其插入到文档中。

// How to get a class type of ApiHyperlink.

// Retrieve class type of ApiHyperlink object and insert it to the document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let run = Api.CreateRun();
run.AddText("ONLYOFFICE Document Builder");
paragraph.AddElement(run);
let hyperlink = paragraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic");
let classType = hyperlink.GetClassType();
paragraph = Api.CreateParagraph();
paragraph.AddText("Class type: " + classType);
doc.Push(paragraph);