|
|
|
date: Tue, 31 Jan 2006 18:10:45 +0530,
group: microsoft.public.word.vba.customization
back
Re: automatically closing Access datasource after Word merge
Hi Btc,
It always helps to mention the version of Word involved in a problem.
Word's mail merge changed significantly in Word 2002. I can tell from the
behavior you describe that you're using a DDE connection to the Access
database. Given the problems you're having, an ODBC connection would be
better, but I can't tell you how to get that syntax unless I know the
version of Word involved.
Also: does your data contain any numbers or dates that require a
particular format?
> I have created a userform that allows for several mailmerge templates
> to be selected and merged with specific records from an Access
> Database.
>
> It is working beautifully, however with each merge, the Access database
> opens. If the user merges, say, 10 templates, then 10 copies of the
> database opens.
>
> Is there a way I can do this that either:
>
> a) closes the datasource after merge (the datasource is Access not
> Word); or
> b) reads the datasource without having to open it.
> or
> c) any other way you may be able to think of.
>
> Thanks for your help.
>
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)
date: Tue, 31 Jan 2006 17:05:34 +0100
author: Cindy M -WordMVP-
Re: automatically closing Access datasource after Word merge
Hi Btc,
> The version of Word and Access is 2000.
>
OK. You'll need to record a macro while making the ODBC connection in order
to get the syntax you need for the OpenDataSource method. But you might want
to make a couple of dry runs first, just to be sure you've got the moves
down.
In the Open DataSource dialog box activate the "Select method" checkbox.
This should bring up a list of available connection methods, select ODBC.
If you need to connect to a query in the Access database, click the
"Options" button in the next dialog box and activate "Views" in the one that
follows. That should append a list of queries to the list of tables.
> It always helps to mention the version of Word involved in a problem.
> Word's mail merge changed significantly in Word 2002. I can tell from the
> behavior you describe that you're using a DDE connection to the Access
> database. Given the problems you're having, an ODBC connection would be
> better, but I can't tell you how to get that syntax unless I know the
> version of Word involved.
>
> Also: does your data contain any numbers or dates that require a
> particular format?
>
> > I have created a userform that allows for several mailmerge templates
> > to be selected and merged with specific records from an Access
> > Database.
> >
> > It is working beautifully, however with each merge, the Access database
> > opens. If the user merges, say, 10 templates, then 10 copies of the
> > database opens.
> >
> > Is there a way I can do this that either:
> >
> > a) closes the datasource after merge (the datasource is Access not
> > Word); or
> > b) reads the datasource without having to open it.
> > or
> > c) any other way you may be able to think of.
>
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :-)
date: Wed, 01 Feb 2006 18:23:58 +0100
author: Cindy M -WordMVP-
|
|