Get Started
Usage API
More information

SetDisplayedText

SetDisplayedText(sDisplay) → { bool }

Set the hyperlink display text.

Parameters:

Name Type Description
sDisplay string

The text to display the hyperlink.

Returns:

Type
bool

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oHyperlink = oParagraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic");
oHyperlink.SetDisplayedText("Api ONLYOFFICE DocBuilder");
builder.SaveFile("docx", "SetDisplayedText.docx");
builder.CloseFile();

Resulting document