Hey Guys..
I am trying to complete an automated mail merge.. It goes through
successfully, but because I have the mail merge destination to a new
document, it creates a new document for the output of the mail merge. If
possible i need the output to stay on the current document... I have tried
ommiting the Destination property and it still launches a new document. Even
if I cant get it to stay on the current document... how do i reference the
new document??
When I first create a document, I create a new document from a tremplate
Doc = App.Documents.Add(Application.StartupPath() & "\template.dot",
Visible:=True)
This loads a new document into the doc variable formated to my template. So
I would like the mailmerge to store into the document that is in the doc
variable.....
A copy of my code is below...
MailMerge = Doc.MailMerge
MailMerge.OpenDataSource(Name:=Application.StartupPath() &
"\temp\merge.doc", LinkToSource:=True, AddToRecentFiles:=False)
MailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument
MailMerge.Execute(False)
Thanks very much
Nathan
Doug Robbins - Word MVP - 22 Feb 2006 20:41 GMT
You cannot do that. I can' imagine why you would want to. You will have to
execute the merge to a new document.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hey Guys..
>
[quoted text clipped - 27 lines]
>
> Nathan
Nathan Franklin - 22 Feb 2006 21:03 GMT
would i just close the current document then after the merge and reference
the new document as App.ActiveDocument. there is only 1 merge document....
> You cannot do that. I can' imagine why you would want to. You will have
> to execute the merge to a new document.
[quoted text clipped - 30 lines]
>>
>> Nathan
Doug Robbins - Word MVP - 23 Feb 2006 05:22 GMT
Assuming that you have declared Doc as in
Dim Doc as Document
Then after executing the merge, if you use:
Doc.Close wdDoNotSaveChanges
that will close the mailmerge main document and leave you with the document
created as a result of executing the merge to a new document.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> would i just close the current document then after the merge and reference
> the new document as App.ActiveDocument. there is only 1 merge document....
[quoted text clipped - 33 lines]
>>>
>>> Nathan