Macro Needs to Close dialog box

M

mhgreene

I recorded a macro to open a document, connect with the external database,
merge to printer and then close the document. Two times during the running
of the macro a dialog box pops up and requires my manual response by clicking
the Yes or No button. Is there a command I can add to the VBA to have the
code complete this task?

One of the last lines of code is:
ActiveWindow.Close
which causes a dialog box to open asking if I want to save the changes to
the document Yes/No.
 
P

Pete Bennett

.... and then ActiveDocument.Close SaveChanges:=False just to be on the safe
side.

There's no accounting for Word when it decides to set the saved flag through
no fault of your own...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top