Get Started
Documentation

SetBold

SetBold(isBold)

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, oTextPr;
oTextPr = oDocument.GetDefaultTextPr();
oTextPr.SetBold(true);
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("A sample text with the font weight set to bold using the text properties.");
builder.SaveFile("docx", "SetBold.docx");
builder.CloseFile();

Resulting document