SetDisplayedText
Sets the hyperlink display text.
Parameters:
Name |
Type |
Description |
sDisplay |
string
|
The text to display the hyperlink. |
Returns:
- Type
-
boolean
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oRun = Api.CreateRun();
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
var oHyperlink = oParagraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic");
oHyperlink.SetDisplayedText("Api ONLYOFFICE DocBuilder");
builder.SaveFile("docx", "SetDisplayedText.docx");
builder.CloseFile();
Resulting document