GetSelection method (VBA Add-In Object Model)

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.