跳到主要内容

SetBold

Sets the bold property to the text character.

Syntax

expression.SetBold(isBold);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isBoldRequiredbooleanSpecifies if the Range contents are displayed bold or not.

Returns

ApiRange | null

Example

This example sets the bold property to the text character.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 24);
range.SetBold(true);