Skip to main content

SetDisplayedText

Sets the hyperlink display text.

Syntax

expression.SetDisplayedText(sDisplay);

expression - A variable that represents a ApiHyperlink class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sDisplayRequiredstringThe text to display the hyperlink.

Returns

boolean

Example

This example sets the hyperlink display text.

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");
hyperlink.SetDisplayedText("Api ONLYOFFICE DocBuilder");