TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

SetBold

SetBold(isBold) → { ApiRange | null }

Sets the bold property to the text character.

Parameters:

Name Type Description
isBold boolean

Specifies if the Range contents are displayed bold or not.

Returns:

Type
ApiRange | null

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = oDocument.GetRange(0, 24);
oRange.SetBold(true);
builder.SaveFile("docx", "SetBold.docx");
builder.CloseFile();

Resulting document