SetShd

SetShd(sType, r, g, b) → { ApiRange | null }

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

Parameters:

Name Type Description
sType ShdType

The shading type applied to the contents of the current text Range.

r byte

Red color component value.

g byte

Green color component value.

b byte

Blue color component value.

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 = oDocument.GetRange(0, 24);
oRange.SetShd("clear", 255, 111, 61);
builder.SaveFile("docx", "SetShd.docx");
builder.CloseFile();

Resulting document