Get Started
Documentation

SetShd

SetShd(sType, r, g, b)

Inherited From:

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

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("This is just a sample text. ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetShd("clear", 0, 255, 0);
oRun.AddText("This is a text run with the text shading set to green.");
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetShd.docx");
builder.CloseFile();

Resulting document