View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default How do I establish an OLE DB connection for an mde database?

Hi Dixie,

I am having problems mailmerging with text files sent out to the local drive
from within Access 2003, then having word documents target them for the
merge data. The mailmerge templates seem to lose their target after a while
for no apparent reason - no idea why.

I tried to include the path to the mailmerge data in the VBA code in Access
that opens the word template. It worked fine for an mdb database, but when
I compiled it into an mde, it did not.

I am definitely no expert in this area, but is this due to the wrong
connection method? I think DDE is being used by the program - it is
programmed in Office 2000, but being run on Office 2003.

Certainly, Word cannot use DDE to connect to a plain text type of data source;
this is only used for Excel and Access. FWIW, the object model for connecting
to data sources changed substantially after Word 2000. So it's quite possible
that Word 2003 is using a different connection method than Word 2000, with the
same code.

FWIW, if your code opens main merge documents attached to a data source, the
current security measures will automatically unlink the data source. You have
to re-attach it using the OpenDataSource method.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :-)