SetShd
Specifies the shading applied to the contents of the current text Range.
Syntax
expression.SetShd(type, color);
expression - A variable that represents a ApiRange class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| type | Required | ShdType | The shading type applied to the contents of the current text Range. | |
| color | Required | ApiColor | No description provided. |
Returns
ApiRange | null
Example
This example specifies the shading applied to the contents of the current text Range.
- Code
- Result
// How to set a shading for a range text.
// Get a range text, specify its shading options.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 24);
range.SetShd("clear", Api.HexColor('#FF6F3D'));