SelStart 属性SelStart property

Indicates the starting point of selected text, or the insertion point if no text is selected.Indicates the starting point of selected text, or the insertion point if no text is selected.

语法Syntax

对象SelStart[= Long ]object.SelStart [= Long ]

“SelStart”**** 属性语法包含以下部分:The SelStart property syntax has these parts:

PartPart 说明Description
objectobject 必需。Required. 一个有效的对象。A valid object.
LongLong 可选。Optional. 指定所选文本的起点的数值表达式。A numeric expression specifying the starting point of text selected.

对于SelLengthSelStart, 设置的有效范围为0到**ComboBox** 或**TextBox** 的编辑区域中的总字符数。For SelLength and SelStart, the valid range of settings is 0 to the total number of characters in the edit area of a ComboBox or TextBox.

默认值为 0。The default value is zero.

备注Remarks

“SelStart”**** 属性始终有效,即使控件没有焦点The SelStart property is always valid, even when the control does not have focus. 将“SelStart”**** 设置为小于零的值将导致错误。Setting SelStart to a value less than zero creates an error.

SelStart 属性设置为大于控件的字符数会使该属性的值等于控件中的字符数。Attempting to set SelStart to a value greater than the number of characters available in a control results in a value equal to the number of characters in the control.

更改 SelStart 属性的值会取消控件中任何现有的选择,并在文本中放置插入点,而且将 SelLength 属性设置为 0。Changing the value of SelStart cancels any existing selection in the control, places an insertion point in the text, and sets the SelLength property to zero.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.