View Single Post
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?B?Sm9obiBMYW5l?=,

I'm not 100% certain I understand - unfamiliar terminology, I think. Let me put
the process into Word terminology, and see if we're on the same wavelength:

You code opens the main merge document (the document with the merge fields). You
then connect it to the data source with a specific SQL, so that a specific set
of data will be pulled. Then you execute the mail merge to a new document; the
result document.

And you're concerned about closing the main merge document so that the user need
not do so?

Declare an object variable, and set it to the main merge document. Based on your
current code, something like this:

objWord.Close objWord.Application.wdDoNotSaveChanges

I have the code snipet below that runs Word Mail Merge from Access. 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


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)