Lines Method

Applies To

CodeModule object.

Description

Returns a specified line of code.

Syntax

object.Lines(startline, count) As String

The Lines syntax has these parts:

Part

Description

object

Required. An object expression that evaluates to an object in the Applies To list.

startline

Required. A Long specifying the first line of the code you want to return.

count

Required. A Long specifying the number of lines you want to return.


Remarks

The line numbers in a code module begin at 1.

See Also

CodePane object, DeleteLines method, Find method, GetSelection method, InsertLines method, ProcBodyLine method, ProcCountLines method, ProcOfLine method, ProcStartLine method.

Example

The following example uses the Lines method to return a specific block of code, lines 1 through 4, in a particular code pane.

Debug.Print Application.VBE.CodePanes(1).CodeModule.Lines(1, 4)