Filling mail fields without database

B

Bjorn Buijing

The company I'm working for has quite a lot of mail merge documents.
I'm writing an customer relation application and want to merge the data with
those documents.
So my question is wether there is a way to fill those fields (for example
with VBA or something) without having an active db connection from word.
I've been going through a lot of documentation and websites, but thus far
I've found zip, so any help in the right direction is greatly appreciated.

Bjorn
 
P

Peter Jamieson

Not completely sure what you are hoping to achieve, but...
a. their mail merge documents will already be connected to a specific data
source. To connect them to anything else, you will obviously have to alter
their documents (perhaps programmatically). I suppose you could do it
temporarily by opening their documents and closing without save, or by
copying their documents. Not sure what you need to achieve there.
b. if you are simply trying to avoid having to have Word connect to /your/
database engine, the simplest approach is probably to export your data to
<whatever format you want> and connect their documents to that exported
data. But if for example your application is sitting on a server, you, and
the users, would need to have to have access to a directory accessible via
Windows networking.

Or if I missed the point, let us know in more detail what you need to do and
what you need to avoid.
 
C

Cindy M -WordMVP-

Hi Bjorn,
The company I'm working for has quite a lot of mail merge documents.
I'm writing an customer relation application and want to merge the data with
those documents.
So my question is wether there is a way to fill those fields (for example
with VBA or something) without having an active db connection from word.
I've been going through a lot of documentation and websites, but thus far
I've found zip, so any help in the right direction is greatly appreciated.
Theoretically, you could automate Word, open the document, and cycle
through the Fields collection, checking the .Code property (or .Result
property) for each field. From this, you can get the name of the field
and replace the field's range with the data...

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

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