SetTextPr
Sets the text properties of the current Range.
Parameters:
Returns:
- Type
-
ApiRange | null
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
oTextPr = oParagraph.GetTextPr();
oTextPr.SetItalic(true);
oRange = oDocument.GetRange(0, 24);
oRange.SetTextPr(oTextPr);
builder.SaveFile("docx", "SetTextPr.docx");
builder.CloseFile();