Saturday, May 28, 2011

Revert to Saved File

Choosing Edit, Undo (or better yet, using Ctrl-Z) is all very well for a few changes, but a professional saves their work every time a significant change has been made, or every time they embark on a risky manoeuvre.
Some of us save our work before we pick up the phone, or as we hear a colleague approaching.
That means that our saved file is the best source of recovering from a failed experiment.

Public Sub FileRevertToSaved()
If Len(ActiveDocument.Path) = 0 Then
MsgBox "You can not revert to an unsaved file."
Else
If MsgBox("Are you sure that you want to abandon your current work?", vbYesNo) = vbNo Then
Else
Documents.Open FileName:=ActiveDocument.FullName, revert:=True
End If
End If
End Sub

No comments:

Post a Comment