This is more of an Access question than a Word question.
Unfortunately, I've listed it twice under the "Macro"
heading on the Access group, without response. It
involves both programs. Anyway, here goes:
I have an Access 2000 db linked to Word 2000 documents
which contain merge fields and Word logic fields. On a
form in the Access db users can click command buttons and
open corresponding linked Word forms. The command
buttons trigger an Access macro. An example of the
command line in the Access RunApp macro triggered by the
command button is as follows:
C:\Program Files\Microsoft
Office\Office\winword.exe "C:\PBdB11162001\Pleadings
(merge)\VoucherSheets.doc"
Is there code I can add to the macro that will cause the
Word doc not only to open, but to merge? Or do I need to
tackle this another way, such as from within Word, and
how might I do that.
Thank you.
Jim
I think you have two options - I'll just describe the overview here.
Option one is to use Access VBA instead of your macro (I'm not that familar
with Access but assume that by "macro" you mean the simple, old-style
sequence of commands). Or if possible, call an Access VBA procedure from
your Macro. Then get the VBA to open the Word document using Automation.
Option two is to put an AutoOpen macro in your Word document. It would
probably just need
Sub AutoOpen()
ActiveDocument.MailMerge.Execute
End Sub
but you might need more code if you needed to specify an output destination
and so on.

Signature
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/
> This is more of an Access question than a Word question.
> Unfortunately, I've listed it twice under the "Macro"
[quoted text clipped - 21 lines]
>
> Jim
Jim - 06 Apr 2004 18:26 GMT
Under option 2, is there code that can be added to the
AutoOpen macro that will cause the template to close
after merger, leaving the newly merged document open?
>-----Original Message-----
>I think you have two options - I'll just describe the overview here.
[quoted text clipped - 41 lines]
>
>.
Doug Robbins - Word MVP - 07 Apr 2004 05:26 GMT
See response to later post.

Signature
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
> Under option 2, is there code that can be added to the
> AutoOpen macro that will cause the template to close
[quoted text clipped - 58 lines]
>>
>>.