auto insertion of extra userdata

N

Nicklarzn

Hey, I hope that there is someone inhere that can help me.
i'm trying to make a standard letter which can be used by all employees in
our firm. and we want word to automatically generate an employee titel.
so that writing letters is both easier and faster.

You can enter some userdater such as name, address, initials - but i need to
automatically insert the writers titel and the city that he/she lives in.

can anyone please help me?
 
S

Stefan Blom

Not if they create personalized versions of the template with the data
already typed in.
 
C

Chip Orange

Where are the user titles stored? In a database, a document which is a
company directory, or Windows Active Directory?

If nowhere, then you'll have to do as has already been suggested and get
each user to create a version of your letter template with their own info in
it. That way they could put a lot more than just tile; they could add
complete address as well. And since they're customizing it, it need not be
in property fields, it could just be in the header part of the letter
template. It's easier for you and them as long as you don't need that info
more than once in the letter.

Chip

Chip
 
G

Gordon Bentley-Mix

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.
 

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