Get Started
Documentation

AddHyperlink

Add a hyperlink to a paragraph.

Parameters:

Name Type Description
sLink string

link to be add.

sScreenTipText string

ScreenTip text

Returns:

Type
ApiHyperlink | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oParagraph.AddHyperlink("http://api.teamlab.info/docbuilder/basic", "docbuilder");
builder.SaveFile("docx", "AddHyperlink.docx");
builder.CloseFile();