SetBold

SetBold(isBold) → { ApiTextPr }

Sets the bold property to the text character.

Parameters:

Name Type Description
isBold boolean

Specifies that the contents of the run are displayed bold.

Returns:

Type
ApiTextPr

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTextPr = oDocument.GetDefaultTextPr();
oTextPr.SetBold(true);
var 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