CreateHyperlink
function CreateHyperlink(
sLink: string = null,
sDisplay: string = null,
sScreenTipText: string = null,
): ApiHyperlink
Description
Creates a new hyperlink text block to be inserted to the current paragraph or table.
Parameters
- sLink
string
null The hyperlink address.
- sDisplay
string
null The text to display the hyperlink.
- sScreenTipText
string
null The screen tip text.
Returns
ApiHyperlink
Try It
var oDocument = Api.GetDocument();
var oHyperlink = Api.CreateHyperlink("https://api.onlyoffice.com/", "ONLYOFFICE Document Builder", "ONLYOFFICE for developers");
var sType = oHyperlink.GetClassType();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oHyperlink, 0);
oParagraph.AddLineBreak();
oParagraph.AddText("Class type of the created object: " + sType);