Macro allowing user to select one of two templates

C

Chris Wagner

I need to create a macro that has two option buttons.

If the user selects the first option button, a specific template using
singular language will run.

If the user selects the second option button, a specific template using
language for multiple signers will run.
 
J

Jezebel

Templates don't "run". Are you trying to do anything more than create a new
document using one of two possible templates?
 
C

Chris Wagner

Sorry - my terminology is probably off.

I need a macro that would show a user form. The user form would show two
option buttons. Depending on which option button was active, one of two
templates would kick off.
 
J

Jonathan West

Chris Wagner said:
Sorry - my terminology is probably off.

I need a macro that would show a user form. The user form would show two
option buttons. Depending on which option button was active, one of two
templates would kick off.

Create a UserForm. Put two optionbuttons on it and one CommandButton

The OptionButtons will be named OptionButton1 and OptionButton2. Put
whatever captions you want on the three buttons.

In the Click event of the CommandButton, include the following code

If OptionButton1.Value Then
Documents.Add Template:="full path of template 1"
ElseIf OptionButton2.Value Then
Documents.Add Template:="full path of template 2"
Else
MsgBox "Make sure one of the template options has been selected
End If
Unload Me

Put the correct full pathnames of your two templates in the appropriate
places in the code.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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