所选内容。上一个方法 (Word)Selection.Previous method (Word)

将选定文本移动指定的单位数, 并返回一个Range对象的相对于折叠的选定内容。Moves the selected text by the specified number of units, and returns a Range object relative to the collapsed selection.

语法Syntax

表达式上一个(单位计数)expression.Previous (Unit, Count)

expression:必需。expression Required. 表示 Selection 对象的变量。A variable that represents a Selection object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
UnitUnit 可选Optional VariantVariant 指定所选内容移动的单位的类型。Specifies the type of unit by which to move the selection. 可以是**** 常量之一。Can be one of the WdUnits constants.
CountCount 可选Optional VariantVariant 要移动的单位数。The number of units by which you want to move. 默认值为 1。The default value is 1.

返回值Return value

RangeRange

备注Remarks

如果所选内容恰好在指定的 Unit 之后,则将所选内容移动到前一个单位。If the selection is just after the specified Unit, the selection is moved to the previous unit. 例如,如果所选内容恰好在一个词之后(尾部空格之前),则以下指令将所选内容往回移动到前一个词。For example, if the selection is just after a word (before the trailing space), the following instruction moves the selection backward to the previous word.

Selection.Previous(Unit:=wdWord, Count:=1).Select

另请参阅See also

Selection 对象Selection Object

支持和反馈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.