跳到主要内容

SetBold

Sets the bold property to the text characters in the current cell or cell range.

Syntax

expression.SetBold(isBold);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isBoldRequiredbooleanSpecifies that the contents of the current cell / cell range are displayed bold.

Returns

This method doesn't return any data.

Example

This example sets the bold property to the text characters in the current cell or cell range.

// How to change the font style properties of a range making it bold.

// Make characters of the ApiRange object bold.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A2").SetValue("Bold text");
worksheet.GetRange("A2").SetBold(true);
worksheet.GetRange("A3").SetValue("Normal text");