Sets the style to the current Range.
Name | Type | Description |
oStyle | ApiStyle | The style which must be applied to the text character. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); oParagraph.AddText("ONLYOFFICE Document Builder"); var oRange = oDocument.GetRange(0, 26); var oStyle = oDocument.GetStyle("Heading 2"); oRange.SetStyle(oStyle); builder.SaveFile("docx", "SetStyle.docx"); builder.CloseFile();