InsertLines Method

Applies To

Module object.

Description

The InsertLines method inserts a line or group of lines of code in a standard module or a class module.

Syntax

object.InsertLines line, string

The InsertLines method has the following arguments.

Argument

Description

object

A Module object.

line

The number of the line at which to begin inserting.

string

The text to be inserted into the module.


Remarks

When you use the InsertLines method, any existing code at the line specified by the line argument moves down.

To add multiple lines, include the intrinsic constant vbCrLf at the desired line breaks within the string that makes up the string argument. This constant forces a carriage return and line feed.

Lines in a module are numbered beginning with one. To determine the number of lines in a module, use the CountOfLines property.

See Also

CountOfLines property, CreateEventProc method, DeleteLines method.

Example

See the CreateEventProc method example.