Update existing MailMerge datasource

K

Klopzi

Hi,

I've been tasked with updating a few thousand Word 2003 documents.
Each of these Word documents uses a CSV file as a datasource for a
mailmerge.

I need to somehow update the datasource name in each of these Word
documents (using a VB shell script). Unfortunately, the datasource
name is a read-only field.

One last problem is the fact that users attempting to access any of the
Word documents are not doing so directly but through another
application's interface (and this application cannot be modified).

Is there a way to automate this process via scripting, or will I be
forced to sift through thousands of Word docs and manually update the
mailmerge datasources?

Thanks in advance.
 
C

Cindy M.

I've been tasked with updating a few thousand Word 2003 documents.
Each of these Word documents uses a CSV file as a datasource for a
mailmerge.

I need to somehow update the datasource name in each of these Word
documents (using a VB shell script). Unfortunately, the datasource
name is a read-only field.

One last problem is the fact that users attempting to access any of the
Word documents are not doing so directly but through another
application's interface (and this application cannot be modified).

Is there a way to automate this process via scripting, or will I be
forced to sift through thousands of Word docs and manually update the
mailmerge datasources?
Automation can do this, but it would involve opening the documents in
Word - it can't be done with the files outside of Word. You also want to
be sure to do it with the Word application visible and a human being
sitting in front of it, as opening mail merge documents can display
messages that need human interaction.

Since you're using Word 2003, when you open a mail merge document using
automation the data source should be unlinked automatically (unless
you've disabled the Security check for attached data sources). This
reduces the likelyhood of messages being displayed.

Once the document is opened, the code needs to execute the OpenDataSource
method to link in the changed data source name. The document then needs
to be saved and closed. You can obtain the basic code for these actions
by recording a macro. This is the *only* way to ascertain the correct
Connection information for any particular mail merge data source.

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

Klopzi

Thanks Cindy.

I'll give your suggestions a shot.
Automation can do this, but it would involve opening the documents in
Word - it can't be done with the files outside of Word. You also want to
be sure to do it with the Word application visible and a human being
sitting in front of it, as opening mail merge documents can display
messages that need human interaction.

Since you're using Word 2003, when you open a mail merge document using
automation the data source should be unlinked automatically (unless
you've disabled the Security check for attached data sources). This
reduces the likelyhood of messages being displayed.

Once the document is opened, the code needs to execute the OpenDataSource
method to link in the changed data source name. The document then needs
to be saved and closed. You can obtain the basic code for these actions
by recording a macro. This is the *only* way to ascertain the correct
Connection information for any particular mail merge data source.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


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