Get Started
Usage API

SetFill

SetFill(oApiFill) → { ApiTextPr }

Set the text color for 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");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oRun = Api.CreateRun();
oRun.AddText("This is a text run with the font color set to blue.");
oFill = Api.CreateSolidFill(Api.CreateRGBColor(0, 0, 255));
oRun.SetFill(oFill);
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetFill.docx");
builder.CloseFile();

Resulting document