Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Macro allowing user to select one of two templates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Wagner - 21 Sep 2005 21:50 GMT
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.
Jezebel - 22 Sep 2005 09:22 GMT
Templates don't "run". Are you trying to do anything more than create a new
document using one of two possible templates?

>I need to create a macro that has two option buttons.
>
[quoted text clipped - 3 lines]
> If the user selects the second option button, a specific template using
> language for multiple signers will run.
Chris Wagner - 22 Sep 2005 13:29 GMT
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.

> Templates don't "run". Are you trying to do anything more than create a new
> document using one of two possible templates?
[quoted text clipped - 6 lines]
> > If the user selects the second option button, a specific template using
> > language for multiple signers will run.
Jonathan West - 22 Sep 2005 14:30 GMT
> 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.

Signature

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 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.