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 oParagraph = oDocument.GetElement(0);
var oRun = Api.CreateRun();
oRun.AddText("This is just a sample text. ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetShd("clear", 255, 111, 61);
oRun.AddText("This is a text run with the text shading set to orange.");
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetShd.docx");
builder.CloseFile();

Resulting document