Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File Revert (Word XP)

    Word VBA is causing me to lose my mind.
    In Word 97, I had a piece of code (just a utility, really) that would allow me to close the current file without saving and open the last SAVED version of it. In effect, it was a sigle-click "File | Revert" command.
    What I'm finding in Word XP now is that the arguments that allowed me to tell Word to close without saving are simply ignored, even though they're documented in the VBA help. Specifically, none of the following three commands prevent Word from asking if I want to save changes. (If I wanted to be asked, I wouldn't have written the code!!)
    ActiveDocument.ActiveWindow.Close SaveChanges:=wdDoNotSaveChanges
    ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
    Documents.Open FileName:=filename, Revert:=True
    As a side-note, Word doesn't even seem to recongnize the "openandrepair:=True" argument in my subsequent "Documents.Open..." command.
    My brain hurts!
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: File Revert (Word XP)

    It must be something in your installation, for

    ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

    and

    Documents.Open FileName:=ActiveDocument.Name, Revert:=True

    both work as expected for me. Perhaps you have other macros interfering (perhaps in a Word add-in). I recommend you to take a look at Phil Rabichow's <!post=Systematic Approach to Behavioral Problems in Word (97/2000),197827>Systematic Approach to Behavioral Problems in Word (97/2000)<!/post>.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File Revert (Word XP)

    Excellent. Thanks. It turned out to be a renegade Normal template.
    I saved Phil Rabichow's guideline some time ago, in the event that I might need it someday. And I guess today was that day. Thanks for your help.
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •