Hi, using Office XP I am running code in Access for a mail
merge in Word. The code opens Word and then displays the
Select Table dialog. I was hoping to avoid this as I don't
want users to have to make a selection.
I also don't want to open a second instance of Access. I
think that setting Revert to False ensures that only one
session of Access is open.
What do I need to change in the code snippet below to
avoid having the select table dialog display?
With objMailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=strThisDb, _
LinkToSource:=True, _
Revert:=False, _
Connection:="QUERY qryMailMerge", _
OpenExclusive:=False
End With
Thanks, any ideas or suggestions appreciated :-)
Cheers
Jonathan
Cindy M -WordMVP- - 20 Jan 2004 20:07 GMT
Hi Jonathan,
Best way to get started is to record connecting to the data
in a macro. That will show you which arguments you're missing
in the OpenDataSource method...
> Hi, using Office XP I am running code in Access for a mail
> merge in Word. The code opens Word and then displays the
[quoted text clipped - 7 lines]
> What do I need to change in the code snippet below to
> avoid having the select table dialog display?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
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 :-)
Jonathan Parminter - 21 Jan 2004 01:08 GMT
Thanks Cindy.
Cheers
Jonathan