跳到主要内容

MoveCursorToStart

Moves a cursor to the start of the document.

Syntax

expression.MoveCursorToStart();

expression - A variable that represents a ApiDocument class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

This example shows how to move the cursor to the start of the document.

const doc = Api.GetDocument();
const paragraph = doc.GetElement(0);
paragraph.AddText('This is the first paragraph.');

const paragraph2 = Api.CreateParagraph();
paragraph2.AddText('This is the second paragraph.');
doc.Push(paragraph2);

doc.MoveCursorToStart();
doc.EnterText('Cursor was moved to the beginning. ');