AddHyperlink
Adds a hyperlink to the specified range.
Parameters:
Name |
Type |
Description |
sLink |
string
|
The link address. |
sScreenTipText |
string
|
The screen tip text. |
Returns:
- Type
-
ApiHyperlink | null
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = oDocument.GetRange(0, 9);
oRange.AddHyperlink("https://www.onlyoffice.com/", "Main portal");
builder.SaveFile("docx", "AddHyperlink.docx");
builder.CloseFile();
Resulting document