Get Started
Documentation

SetBold

SetBold(isBold)

Inherited From:

Set the bold property to the text character.

Parameters:

Name Type Description
isBold boolean Specifies that the contents of this run are displayed bold.

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.SetBold(true);
oRun.AddText("This is a text run with the font set to bold.");
oParagraph.AddElement(oRun);
builder.SaveFile("docx", "SetBold.docx");
builder.CloseFile();

Resulting document