Running Word Mail Merge From Access

G

Guest

I have the code snipet below that runs Word Mail Merge. When Word runs, it
first opens the "skeleton" Word document, then specializes it with the query
and opens it a second time with the parameters filled in. When the user
closes the document, Word now displays the skeleton document/form. Is there a
way to either not show/hide the first instance, or when the user closes the
2nd instance, the 1st instance is closed? Thanks.
Set objWord = GetObject(strFilepath)
objWord.Application.visible = True
objWord.MailMerge.OpenDataSource Name:=CurrentDb.Name, LinkToSource:=True,
SQLStatement:=strSQL
objWord.MailMerge.Execute
 
A

Alex Dybenko

as i see objWord return a reference to "skeleton" Word document, so after
objWord.MailMerge you can either close it, or hide
 

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