Results 1 to 2 of 2
2003-06-02, 18:40 #1
- Join Date
- Jan 2001
- Richmond, Virginia, USA
- Thanked 0 Times in 0 Posts
Macro question suppressing dialog box (2002 SP-2)
This is probably a very easy question, but I just don't know where to find the answer. I have a macro that copies text from a document then closes that document. When it closes the document, it prompts you to save the document. If you answer yes or no to the save prompt, it continues with the macro. How do I make Word automatically select Yes (or No, since it doesn't seem to matter) so I don't have to see that dialog box?
Here's what my macro says:
Should it say something else, instead, or do I just need to add something?
2003-06-02, 18:57 #2
- Join Date
- Nov 2001
- Thanked 7 Times in 7 Posts
Re: Macro question suppressing dialog box (2002 SP-2)
Just add SaveChanges as in
If you want to check whether the document has already been saved then look at ActiveDocument.Saved, and to do the whole thing in one command then try
ActiveDocument.Close SaveChanges:=Not ActiveDocument.Saved
This will save the document if it hasn't already been saved.