Skip to main content

SetShd

Specifies the shading applied to the contents of the current text Range.

Syntax

expression.SetShd(sType, r, g, b);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTypeRequiredShdTypeThe shading type applied to the contents of the current text Range.
rRequiredbyteRed color component value.
gRequiredbyteGreen color component value.
bRequiredbyteBlue color component value.

Returns

ApiRange | null

Example

This example specifies the shading applied to the contents of the current text Range.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 24);
range.SetShd("clear", 255, 111, 61);