>> Mail Merge from Access

J

Jonathan Parminter

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
 
C

Cindy M -WordMVP-

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
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?

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 :)
 

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