AddHyperlink

Adds a hyperlink to a paragraph.

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);
var oRun = Api.CreateRun();
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oParagraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic", "docbuilder");
builder.SaveFile("docx", "AddHyperlink.docx");
builder.CloseFile();

Resulting document