Create a selection box to take you to different templates within 1

G

gem_1

Hi Everyone,

I have been given a task at work to re-create some letter old letter
templates that we send to out clients.
I'm currently using Microsoft word 2003 and our old templates had what I
would call a selection box as soon as you opened the document. The selection
box could have a number of different types to click on and once you selected
a type the correct fields would populate into the template.
The easiest way I can describe it is like different templates within a
template doc.
If anyone has a clue about what I'm trying to do any help would be greatly
appreciated as its becoming very frustrating to do something that I'm sure is
very easy!!

Thanks!
 
J

Jay Freedman

I can tell you how I would approach that task, although it might not
be exactly what was used in the old templates.

The template needs an AutoNew macro or a Document_New macro
(http://www.word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm) whose
only function is to display a userform
(http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm) each
time you create a new document based on the template. The userform is
the "selection box" you mentioned.

Although the article I pointed to has instructions for putting text
boxes on the userform and transferring their contents into the
document, your userform should have a series of option buttons to let
the user choose one (and only one) document type. The OK button will
then have code that, based on which of the option buttons is turned
on, will insert the needed fields into the new document.

If you need help getting this to work, post a more specific
description of the template, the possible fields for each document
type, and any difficulties you've had in the userforms forum,
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.vba.userforms.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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