Get Started
Documentation

SetShd

SetShd(sType, r, g, b)

Specify 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.

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
oRange = oDocument.GetRange(0, 24);
oRange.SetShd("clear", 255, 224, 204);
builder.SaveFile("docx", "SetShd.docx");
builder.CloseFile();