跳到主要内容

GetScreenTipText

返回超链接的屏幕提示文本。

语法

expression.GetScreenTipText();

expression - 表示 ApiHyperlink 类的变量。

参数

此方法没有任何参数。

返回值

string

示例

获取电子表格中形状内超链接的屏幕提示文本。

// How do I get the screen tip text in a spreadsheet?

// Get the screen tip text using a hyperlink object in a spreadsheet.

const worksheet = Api.GetActiveSheet();

const fill = Api.CreateSolidFill(Api.RGB(160, 100, 130));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = worksheet.AddShape(
'roundRect',
Api.MillimetersToEmus(70), Api.MillimetersToEmus(20),
fill, stroke,
0, 0, 2, 0
);

const content = shape.GetContent();
const paragraph = content.GetElement(0);
const run = Api.CreateRun();
run.AddText('Visit ONLYOFFICE for developers');
paragraph.AddElement(run, 0);

const hyperlink = run.AddHyperlink('https://api.onlyoffice.com', 'ONLYOFFICE for developers');
worksheet.GetRange('A1').SetValue('Screen tip: ' + hyperlink.GetScreenTipText());