Can mail merge data source be relative?

M

MyVeryOwnSelf

I have an MS-Word "Address List" file with a table having the typical
address fields.

A number of MS-Word mail-merge documents refer to the Address List file.
They're all in the same folder as the Address List.

From time to time, I rename or move or copy the folder. I'd like the mail-
merge documents to continue using the Address list in their folder, but
Word seems to use an absolute path name as the internal data-source
reference. So I end up having to manually change the data source of each
mail-merge document.

Is there a way to make the data source references relative, so they'll
track the folder renames and moves?

If that's not possible, is there a way to include an environment variable
in the reference? For example, I have a Windows file shortcut with a target
like this:
"C:\Documents and Settings\self\My Documents\%THISYEAR%"
where THISYEAR is an environment variable that gets changed each January 1.
 
C

Cindy M -WordMVP-

Hi MyVeryOwnSelf,
I have an MS-Word "Address List" file with a table having the typical
address fields.

A number of MS-Word mail-merge documents refer to the Address List file.
They're all in the same folder as the Address List.

From time to time, I rename or move or copy the folder. I'd like the mail-
merge documents to continue using the Address list in their folder, but
Word seems to use an absolute path name as the internal data-source
reference. So I end up having to manually change the data source of each
mail-merge document.

Is there a way to make the data source references relative, so they'll
track the folder renames and moves?
No, unfortunately mail merge isn't designed to work on this principle. The
best you can do is to place an AutoOpen macro in each of these documents (or
a template all the documents would share) that would
1. Check the path of the current document
2. Attach the data source

I describe how this is done, and provide code, in "Office VBA Macros you can
use Today" from "Holy Macro" press.

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