automatically connect to word record source

J

jono1970

Hello,

I have written a reports program using a VB front end and an access
backend. When the user prints a report a word mailmerge document opens
and connects to the access table. This works fine until I launch the
program on another computer. When i launch it on another computer the
mailmerge part does not work until i manually create the connection to
access table.

So, is it possible to have word connect to the access table
automatically when opened?

kind regards,

jono
 
C

Cindy M -WordMVP-

Hi Jono1970,
I have written a reports program using a VB front end and an access
backend. When the user prints a report a word mailmerge document opens
and connects to the access table. This works fine until I launch the
program on another computer. When i launch it on another computer the
mailmerge part does not work until i manually create the connection to
access table.

So, is it possible to have word connect to the access table
automatically when opened?
Sort of...

The problem is most likely due to how Word stores the absolute file path
to the data source within the main merge document. This means the main
merge document should be saved without a data source attached.

Then your VB app would open the document and attach the data source. In
order to get the basic syntax for this, record the action in a macro, in
the Word interface. You can then port the OpenDatasource code into your
VB project, adapt it to
- use the document object variable you're using to execute the mail
merge
- concatenate the correct path to the data source

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