SelLength

This property returns and sets the number of selected characters. In addition, you can use this property for tasks such as setting the insertion point, establishing an insertion range, selecting substrings in a control, or clearing text. For copy, cut, and paste operations, use SelLength in conjunction with the Clipboard object.

Syntax

object.SelLength [= number]

Parameters

object
Object expression that evaluates to a ComboBox or TextBox control.
number
Numeric expression that specifies the number of characters selected. The valid range of settings is 0 to text length—the total number of characters in the edit area of a ComboBox or TextBox control.

Remarks

The SelLength property is unavailable at design time. Setting SelLength less than 0 causes a run-time error.