Word Mail Merge asking to save when no changes are made

T

Tony_VBACoder

Can someone tell me why I am being prompted to save my
Mail Merge document when I have made no changes to it?

I am doing the following:
1) Open my Main Word document that has all my Merge fields
on it.
2) Click on the "Merge to New Document" button on
the "Mail Merge" Toolbar.
3) A new document opens with all my merged data.
4) Close my newly Merged Document. It prompts me to save
the document.
5) Close my Main Word document that has all my Merge
fields on it. It prompts me to save my document.

In #5, why is Word asking me to save my document, when I
made no changes to it? Is there some kind of changes
going on in the background that I am not aware of?
 
P

Peter Jamieson

If you look really carefully when you close the merged document and/or
switch back to the mail merge main document, you may be able to see a
message flashing in the status bar saying "reading record 1" or some such.
Well, I can see it with Word 2000 as I have a rather slow old machine :)
But in essence, Word isre-fetching the data for the "current record" and
plugging it into the document,which will "dirty" the document even if the
data is the same as before. I don't suppose it has to do this, but it does.
If you open your mailmerge main document and use the mailmerge toolbar to
preview a different record, then try to close the document, you will
probably see the same thing.
 
T

Tony_VBACoder

Peter, I also noticed that the Mail Merge Toolbar appears
loaded, whereas when I first opened the document, it
wasn't. So I thought it had something to do with
displaying the Mail Merge Toolbar even though I did not
load it.

So how do I get around having to answer "No" to the Save
As dialog? Or better yet, how can I close this document
behind the scenes, so that the user does not have to
answer this question? I am assuming if I destroy/close
the Word object I am using in VBA code to reference this
document, I will essentially be saving the document?
 
P

Peter Jamieson

Or better yet, how can I close this document
behind the scenes, so that the user does not have to
answer this question?

Have you tried

ActiveDocument.Close savechanges:=wdDoNotSaveChanges

(or

oDocument.Close savechanges:=wdDoNotSaveChanges

where oDocument is the relevant document object)

?
 

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