When faced with a similar requirement in the past, I have used the processes
described in Greg Maxey's "Populate UserForm ListBox"
(
http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm) to load user
location information from an external data source (a Word table). I then
wrote code to allow the user to set a selected location (from a list of
nearly 150) as the default location for that particular user. I also employed
a similar process to allow the user to enter their "name", "title" and other
contact information and set these values as the default as well. In both
cases, this was accomplished by storing the "default" information in document
variables in the template (the Values for TextBoxes and the ListIndexes for
ListBoxes).
The first time the user runs the template, they simply enter / select the
default values, tick a checkbox to indicate that the values should be used as
the defaults and then finish the document. During the document creation
process, the code just opens the template in the background, saves the values
and closes the template again, and from that point forward the defaults are
loaded automatically. If the user wants to modify the defaults, it's just a
matter of entering / selecting the revised values and ticking the checkbox
again. And if the user wants to use different values for a "one-off"
situation (for example, writing a letter on behalf of another user), the
values can be overwritten in the UserForm but the defaults will still be
employed the next time the template is run.
The advantages of this process are:
* it needs to only be run once - the first time the user runs the template
- but unlike hardcoding values into the body of the document, the user still
has control over the actual values used in a particular document;
* the user can update the defaults at any time if something changes;
* it is all accomplished through code and from within the UserForm, so the
user doesn't have to open and edit the template.
The only disadvantage is that if a new version of the template is rolled
out, the user has to reset the defaults, but since it's so simple to do...
The code is rather complex, so I'm not going to try to post it.
Unfortunately, I don't have a "simplified" version of the code on hand at the
moment either. However, if this sounds like something that might work, I'll
pull something together.
-----
Cheers!
Gordon
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.