Get Started
Usage API
More information

GetRange

GetRange(Start, End) → { ApiRange }

Return a Range object that represents the document part contained in the specified hyperlink.

Parameters:

Name Type Description
Start Number

Start character index in the current element.

End Number

End character index in the current element.

Returns:

Type
ApiRange

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Api Document Builder");
oHyperlink = oParagraph.AddHyperlink("https://api.onlyoffice.com/docbuilder/basic");
oRange = oHyperlink.GetRange(0, 2);
oRange.SetBold(true);
builder.SaveFile("docx", "GetRange .docx");
builder.CloseFile();

Resulting document