Running Word Mail Merge From Access

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
as i see objWord return a reference to "skeleton" Word document, so after
objWord.MailMerge you can either close it, or hide
 
Back
Top