GoToLine Method

Home Page (Objects)OverviewFAQReference

Applies to: TextSelection object

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

Syntax

object.GoToLine line [, 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:

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