GetSelection Method

Applies To

CodePane object.

Description

Returns the selection in a code pane.

Syntax

object.GetSelection(startline, startcol, endline, endcol)

The GetSelection 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 that returns a value specifying the first line of the selection in the code pane.

startcol

Required. A Long that returns a value specifying the first column of the selection in the code pane.

endline

Required. A Long that returns a value specifying the last line of the selection in the code pane.

endcol

Required. A Long that returns a value specifying the last column of the selection in the code pane.


Remarks

When you use the GetSelection method, information is returned in output arguments. As a result, you must pass in variables because the variables will be modified to contain the information when returned.

See Also

CodeModule object, DeleteLines method, Find method, InsertLines method, Lines method, ProcBodyLine method, ProcCountLines method, ProcOfLine method, ProcStartLine method.

Example

The following example returns the locations of the starting and ending points of the current selection in CodePanes(1). The last line in the example uses the GetSelection method to place the four values in the four variables.

Dim m As Long
Dim n As Long
Dim x As Long
Dim y As Long
Application.VBE.CodePanes(1).GetSelection m, n, x, y