• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. The Word Workspace > 5. Revert to Saved

Revert to Saved

Most other word processors and layout programs put a Revert to Saved command right on the File menu. This allows for a quick return to the last saved version of a file. This hack shows you how to add this feature in Word.

While editing a document, you make a mistake. A big mistake. You try the Undo command a few times, but you can’t quite retrace your steps. In frustration, you close the document without saving your changes, then reopen it. This is a minor annoyance, but it may be something you have to do a lot. Fortunately, there’s an easier way.

The Code

To put a Revert to Saved option on your File menu, add this macro to Normal.dot:

Sub FileRevertToSaved( )
Dim sDocPath As String
Dim sDocFullName As String

sDocFullName = ActiveDocument.FullName
sDocPath = ActiveDocument.Path

If Len(sDocPath) = 0 Then
    MsgBox "Can't revert a document that's never been saved."
    Exit Sub
End If

If MsgBox("Really revert to last saved version? " & _
          "(Can't be undone)", _
           vbYesNo) = vbNo Then
   Exit Sub
End If

Documents.Open FileName:=sDocFullName, Revert:=True
End Sub

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint