PreviousField Method

Microsoft Word Visual Basic

Selects the previous field. If a field is found, this method returns a Field object; if not, it returns Nothing.

expression.PreviousField

expression    Required. An expression that returns a Selection object.

Example

This example updates the previous field (the field immediately preceding the selection).

If Not (Selection.PreviousField Is Nothing) Then
    Selection.Fields.Update
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"