How do I automate Access and Word Templates?

R

rg

I have been given the task of automating the following and need help.

The user has 4 Word templates currently used for mail merge.

They want to continue using the templates but want to put data into a new
Access database (Office 2003) and when a record in Access is selected, it
loads the 4 Word templates, puts the appropriate field data into the
documents, and saves them to a directory based on a client number.

I need help on how to do this and where to start. I have background in
Access, VB6, some automation.

Any guidance is appreciated.

Regards, Roy
 
C

Cindy M.

Hi Rg,
I have been given the task of automating the following and need help.

The user has 4 Word templates currently used for mail merge.

They want to continue using the templates but want to put data into a new
Access database (Office 2003) and when a record in Access is selected, it
loads the 4 Word templates, puts the appropriate field data into the
documents, and saves them to a directory based on a client number.

I need help on how to do this and where to start. I have background in
Access, VB6, some automation.
Start by doing a Google search on the groups in the microsoft.public space.
This has come up numerous times over the years... Basically, you're looking
for discussions on finding mergefields.

To summarize the approach: you need to loop through the fields collection
of the document, determine whether you're dealing with the Type mergefield
(there's an wdfield enum) and if you are, extract the field name from the
field's Code property.

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

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