MoveCursorToPos
function MoveCursorToPos(nPos: number = 0): boolean
Description
Move cursor to a specified position of the current text run. If the current run is not assigned to any part of the document then returns false otherwise returns true. If there was any selection in the document, it will be removed.
Parameters
- nPos
number
0 Desired cursor position.
Returns
boolean
Try It
let oDocument = Api.GetDocument();
let oPara = oDocument.GetElement(0);
let oRun = oPara.AddText("The quick brown fox jumps over the lazy dog");
oRun.MoveCursorToPos(16);