Get Started
Usage API
More information

SetFill

SetFill(oApiFill) → { ApiTextPr }

Sets the text color to the current text run.

Parameters:

Name Type Description
oApiFill ApiFill

The color or pattern used to fill the text color.

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 a text run with the font color set to orange.");
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
oRun.SetFill(oFill);
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetFill.docx");
builder.CloseFile();

Resulting document