SelText

This property returns and sets the string that contains the currently selected text. If no characters are selected, the string is a zero-length string (""). 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 SelText in conjunction with the Clipboard object.

Syntax

object.SelText [= value]

Parameters

object
Object expression that evaluates to a ComboBox or TextBox control.
value
String expression that contains the selected text.

Remarks

The SelText property is unavailable at design time.

Setting SelText to a new value sets SelLength to 0 and replaces the selected text with the new string.