GoToLine Method

Home Page (Objects)OverviewFAQReference

Applies to: TextSelection object

Moves the insertion point to a specified line in a document.

Syntax

object**.GoToLineline [,**select ]

Parameters

object

An expression that evaluates to a TextSelection object.

line

A Long that represents the number of the line to which you want to go. If you specify dsLastLine or if line is beyond the last line in the document, the last line is chosen.

select

(Optional) A string constant of type DsGoToLineOptions that indicates how to select the line to which you want to go. Possible values are:

  • dsSelect   Selects the entire line.

  • dsMove   Moves the insertion point to the beginning of the line, but does not select any part of the line (the default).

Example

The following example moves the insertion point to the third line in a document and selects the entire line:

ActiveDocument.Selection.GoToLine 3 dsSelect