Marco to close a document without saving it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used to have a neat macro that had a keyboard assignment of alt+w, and the
macro would allow me to exit a document without saving it. I have tried to
recreate the macro, but it won't work now. For some reason, the macro will
not record the letter "N" for no, I don't want to save changes. Can anyone
help me with this weird problem? I would like to just be able to do the
alt+w and be done with it and not have to type in the "N" key immediately
afterwards. I created this macro initially so I wouldn't have to make the no
choice. It's a pain having to do this as much as I am working in word all
day. Thanks anyone that can help.
 
You could assign this macro to the alt+w keyboard shortcut:

Sub myCloseDoc()
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
End Sub
 
I'm confused, what is the sub myclose thingie? When I record a macro, I
assign it a keyboard shortcut, then it goes into the actualy recording of the
macro, that's when I do the "File, close" etc. I don't understand what you
wrote - I'm a dummy when it comes to some of this stuff. Can you reply?
Thanks Greg
 
Ok, I went back and edited the macro and added what you put. IT WORKED!!!
Only thing is that after it closes the document without saving, it minimizes
my Microsoft Word screen and I have to maximize it again. Did I do something
wrong? Thanks sooooooo much for your help
 
Resolved off-line.

Ok, I went back and edited the macro and added what you put. IT WORKED!!!
Only thing is that after it closes the document without saving, it minimizes
my Microsoft Word screen and I have to maximize it again. Did I do something
wrong? Thanks sooooooo much for your help
 
Back
Top