Get Started
Documentation

SetVertAlign

SetVertAlign(sType) → { ApiRange | null }

Specify the alignment which will be applied to the contents of this Range in relation to the default appearance of the Range text:

  • "baseline" - the characters in the current text Range will be aligned by the default text baseline.
  • "subscript" - the characters in the current text Range will be aligned below the default text baseline.
  • "superscript" - the characters in the current text Range will be aligned above the default text baseline.

Parameters:

Name Type Description
sType "baseline" | "subscript" | "superscript"

The vertical alignment type applied to the text contents.

Returns:

Type
ApiRange | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Copyright Document Builder");
oRange = oDocument.GetRange(10, 18);
oRange.SetVertAlign("superscript");
builder.SaveFile("docx", "SetVertAlign.docx");
builder.CloseFile();