SetHighlight
Specifies a highlighting color which is applied as a background to the contents of the current Range.
Syntax
expression.SetHighlight(sColor);
expression
- A variable that represents a ApiRange class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
sColor | Required | highlightColor | Available highlight color. |
Returns
ApiRange | null
Example
This example specifies a highlighting color which is applied as a background to the contents of the Range.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 26);
range.SetHighlight("lightGray");