Code Pane Methods

Name Parameters

Description

GetSelection

StartLine As Long, StartColumn As Long, EndLine As Long, EndColumn As Long

SetSelection

StartLine As Long, StartColumn As Long, EndLine As Long, EndColumn As Long

Show

Used to retrieve the currently selected text. All of the arguments are passed ByRef and are modified within the procedure to return the selection. All arguments are required, but it is only required to pass arguments for those items you want to retrieve. For example, to get only the start line, you can use: Dim lStart As Long

Application.VBE.ActiveCodePane.GetSelection lStart, 0,0,0

Used to set the position of the currently selected text. A program would typically read the selection using GetSelection, modify the code, then set the selection back again using SetSelection. See the PrintProcedure routine in Chapter 26 for an example.

Opens and displays the CodePane, making it active.

The CodePanes collection contains all of the open CodePane objects in the VBE.

Was this article helpful?

0 0

Post a comment