Get Started
Usage API
More information

SetPosition

SetPosition(nPosition) → { ApiRange | null }

Specify the amount by which text is raised or lowered for this Range in relation to the default baseline of the surrounding non-positioned text.

Parameters:

Name Type Description
nPosition hps

Specifies a positive (raised text) or negative (lowered text) measurement in half-points (1/144 of an inch).

Returns:

Type
ApiRange | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text. ");
oParagraph.AddText("This is a text run with the text raised 5 points (10 half-points).");
oRange = oDocument.GetRange(22, 75);
oRange.SetPosition(10);
builder.SaveFile("docx", "SetPosition.docx");
builder.CloseFile();

Resulting document