PreviousField 方法 (Word)Selection.PreviousField method (Word)

选择并返回前一域。Selects and returns the previous field.


expression.expression. PreviousField

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

返回值Return value



如果此方法找到一个字段,它返回一个 字段;如果不是,则返回 NothingIf this method finds a field, it returns a Field object; if not, it returns Nothing.


本示例更新前一个域(选定内容前面的域)。This example updates the previous field (the field immediately preceding the selection).

If Not (Selection.PreviousField Is Nothing) Then 
End If

本示例选定前一个域。如果找到了一个域,则在状态栏显示一条信息。This example selects the previous field, and if a field is found, displays a message in the status bar.

Set myField = Selection.PreviousField 
If Not (myField Is Nothing) Then StatusBar = "Field found"

另请参阅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.