Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2005

Tip: Looking for answers? Try searching our database.

Question on Mail Merge from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Lane - 16 Mar 2005 00:11 GMT
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 M  -WordMVP- - 22 Mar 2005 22:31 GMT
Hi =?Utf-8?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
[quoted text clipped - 7 lines]
> 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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.