Selection.PreviousRevision method (Word)

Locates and returns the previous tracked change as a Revision object.


expression. PreviousRevision( _Wrap_ )

expression Required. A variable that represents a Selection object.


Name Required/Optional Data type Description
Wrap Optional Variant True to continue searching for a revision at the end of the document when the beginning of the document is reached. The default value is False.

Return value



This example selects the last tracked change in the first section in the active document and displays the date and time of the change.

Selection.EndOf Unit:=wdStory, Extend:=wdMove 
Set myRev = Selection.PreviousRevision 
If Not (myRev Is Nothing) Then MsgBox myRev.Date

This example rejects the previous tracked change found if the change type is deleted or inserted text. If the tracked change is a style change, the change is accepted.

Set myRev = Selection.PreviousRevision(Wrap:=True) 
If Not (myRev Is Nothing) Then 
 Select Case myRev.Type 
 Case wdRevisionDelete 
 Case wdRevisionInsert 
 Case wdRevisionStyle 
 End Select 
End If

See also

Selection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.