View Single Post
  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Yes, the change to "not a merge document" really needs to be a one-off
action which yu now know how to do. After that, the name of the game is that
you either prevent the user from saving the mail merge main document after
the merge, or, since you are automating the merge, you should be able to put
the statement after the Mailmerge.Execute. But you need to use the right
document object variable to do that, and immediately after the merge
executes the ActiveDocument is the /new/ document, so you need to use

objWord.MailMerge.MainDocumentType = wdNotAMergeDocument

(I think you were using objWord to refer to the Mail Merge Main Document in
your code?)

Another possibility is to put

Activedocument.MailMerge.MainDocumentType = wdNotAMergeDocument

in an AutoClose macro (i.e. create a module in the document, create a sub
called AutoClose(), and put the appropriate statement in there), but I would
avoid that if possible.

Peter Jamieson


"TL" wrote in message
...
Thank you so much for your help! The prompt issue is related to the
document
already being linked to the datasource. I am encountering a small
problem,
though. I have tried using the code:

Activedocument.MailMerge.MainDocumentType = wdNotAMergeDocument

to fix this, but I am apparently not putting in the right place in my
code.
I have been getting various errors depending on where I place it. So, I
went
straight to the document and changed it with the setting "Normal Word
Document and saved it. This only works the first time the merge is
executed.
When you click the Merge button again the prompt for the RecordID comes up
again. I am assuming, (and I never really like to do that), that this is
because when the Mail Merge is Executed the document is changed to a Mail
Merge Document during the Execute of the first Mail Merge - hence the need
for the above code. So, my question is: Where exactly do I need to place
the above code in order for the document to be returned to a normal
document?
I have tried several places with no luck.

Tiffany