Share via


MoveTo Method

Home Page (Objects)OverviewFAQReference

Applies to: TextSelection object

Moves the insertion point to a specified line and column.

Syntax

object**.MoveToline,column [,**extend]

Parameters

object

An expression that evaluates to a TextSelection object.

line

A Long specifying the line number . Some possible values are:

  • 0   Does not move the insertion point; it stays on the current line.

  • 1   Moves the insertion point to the first line.

  • dsLastLine   Moves the insertion point to the last line in the file.

column

A Long specifying the column number. If this number is greater than the number of the rightmost column, this number becomes the number of the rightmost column. Some possible values are:

  • 0   Does not move the insertion point; it stays in the current column.

  • 1   Moves the insertion point to the first column.

  • dsEndOfLine   Moves the insertion point to the end of the line.

extend

(Optional) A string constant of type DsMovementOptions that specifies what to do with the selection. Possible values are:

  • dsExtend   Extends the selection.This is the same as pressing SHIFT+UP ARROW.

  • dsMove   Does not extend the selection (the default).

Example

The following example moves the insertion point to the third column in the second line:

ActiveDocument.Selection.MoveTo 2 3

See Also   LineDown method.