CreateRange
Creates an element range.
If you do not specify the start and end positions, the range will be taken from the entire element.
Parameters:
This method doesn't have any parameters.
Returns:
- Type
-
ApiRange | null
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = Api.CreateRange(oParagraph, 0, 9);
oRange.SetBold(true);
builder.SaveFile("docx", "CreateRange.docx");
builder.CloseFile();
Resulting document