GetRange
Returns a Range object that represents the document part contained in the specified hyperlink.
Syntax
expression.GetRange(Start, End);
expression
- A variable that represents a ApiHyperlink class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
Start | Required | Number | Start position index in the current element. | |
End | Required | Number | End position index in the current element. |
Returns
Example
This example shows how to get a Range object that represents the document part contained in the specified hyperlink.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("Api Document Builder");
let hyperlink = paragraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic");
let range = hyperlink.GetRange(0, 2);
range.SetBold(true);