Mail Merge not working in XP

C

Chris Kennedy

I have a VBA procedure in Access which opens up Word and creates a
mail merge based on a dynamicly created SQL statement. It works in
Word 2000 but not in XP. In XP I get a 'data source could not be
opened' error. It connects via OLEDB. I am also sure it is not a
network security issue as the two machines access the same network
share but using XP and 2000 respectively. Unfortunately I don't have
the code at hand. I was just wondering if there was something obvious.
 
R

Rocky B

SInce it's using OLEDB, you may need to reconfigure the
ODBC DNS info using COnrol Panel and Data Sources to
reestablish the ODBC link to your database. That's the
first thing that comes to mind.
Rocky B
 
P

Peter Jamieson

It doesn't connect via OLEDB in Word 2000, which doesn't support it. It
probably connects via ODBC. In which case, it probably won't work in Word XP
unless you add the parameter Subtype:=wdMergeSubtypeWord2000 to your
OpenDataSource call. And unfortunately, that will only work in Word XP.
 
C

Cindy M -WordMVP-

Hi Chris,

Following up on Peter's response to you, about adding the SubType
argument to your OpenDataSource method...

You'll get an error message in Word 2000 if you try to compile a
module containing the SubType argument. BUT you can check the .Version
property of the application, and if it's greater than 10 call a
procedure in *another module* with the Word 10-specific code. Since a
module is only compiled when it's called the first time, and Word 9
would never call it, you can easily have the code for both versions in
the same project - just not in the same module.
I have a VBA procedure in Access which opens up Word and creates a
mail merge based on a dynamicly created SQL statement. It works in
Word 2000 but not in XP. In XP I get a 'data source could not be
opened' error. It connects via OLEDB. I am also sure it is not a
network security issue as the two machines access the same network
share but using XP and 2000 respectively. Unfortunately I don't have
the code at hand.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

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