SetSelection Method

Applies To

CodePane object.

Description

Sets the selection in the code pane.

Syntax

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

The SetSelection 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 selection.

startcol

Required. A Long specifying the first column of the selection.

endline

Required. A Long specifying the last line of the selection.

endcol

Required. A Long specifying the last column of the selection.


See Also

GetSelection method, SetFocus method, Window object.

Example

The following example uses the SetSelection method to select the text whose first character is the one immediately after the fourth character on the second line of CodePanes(1) and whose last character is the fifteenth character on the third line.

Application.VBE.CodePanes(1).SetSelection 2,4,3,15