VB to show a form for users to enter an address for a template

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I work for a large company with many branches around the country.

We want each branch to have access to a range of document templates. The
idea is when a user downloads and opens template, the first thing they have
to do is select from a list that pops up confirming which branch they are
from.

The template will then automatically poulate the template page one header
with the relevant branch address, phone and facsimile details.

I normally do this type of stuff in Excel but this is the first time using
VB and Macros in word.

Any pointers??
 
1. Work with custom document properties. Define a custom property for each
of the values you're interested in -- branch name, address, phone, etc. If
these are defined in a template, they are inherited by documents created
from the template. Use DocProperty fields to display the values in the
document.

2. Consider a no-macro approach: when you send out a template, insert dummy
values like '[branch name]', '[phone number]', etc. It's obvious to the user
that they have to do something about it; and it's not too hard to teach
people to open the template itself and use File > Properties > Custom.

3. If you want to automate it, write a macro that runs when a new document
is created, checks if the properties have ever been set and if not displays
a UserForm to edit and save. Rather than putting the macro in every
template, put it in an add-in. If you take this approach you'll also need to
provide a way for users to get back to it when their phone number changes.
And be aware that this sort of exercise is hell on wheels to support.
 

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

Back
Top