Get Started
Usage API
More information

GetShd

GetShd() → { ApiRGBColor }

Inherited From: ApiParaPr.GetShd

Get the shading applied to the contents of the paragraph.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiRGBColor

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is an example of setting a shade to a paragraph. ");
oParagraph.SetShd("clear", 255, 0, 0, false);
oShade = oParagraph.GetShd();
oParagraph = Api.CreateParagraph();
oFill = Api.CreateSolidFill(oShade);
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 10 * 36000, 3 * 36000, oFill, oStroke);
oParagraph.AddText("Shade: ");
oParagraph.AddDrawing(oDrawing);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetShd.docx");
builder.CloseFile();

Resulting document