SetBold

SetBold(isBold) → { ApiTextPr }

Sets the bold property to the text character.

Parameters:

Name Type Description
isBold boolean

Specifies that the contents of the current run are displayed bold.

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