SetShd

SetShd(sType, r, g, b) → { ApiTextPr }

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

Parameters:

Name Type Description
sType ShdType

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

r byte

Red color component value.

g byte

Green color component value.

b byte

Blue color component value.

Returns:

Type
ApiTextPr

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTextPr = oDocument.GetDefaultTextPr();
oTextPr.SetShd("clear", 255, 111, 61);
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("A sample text with the shading set to orange.");
builder.SaveFile("docx", "SetShd.docx");
builder.CloseFile();

Resulting document