simple question Im sure

B

Benji

I have just finished writing my first macro and I need to put it into my
list of macros. I dont see it. The thing is its a form and I wrote the code
in the userform section so Im just wondering how I get it into my list of
macros for this template can someone help me with that. Much appreciated.
Also wondering what the best way would be to distribute this template to the
office with the macros.

Thanks
 
C

Charles Kenyon

You need a separate macro in a module or in the This Document component that
activates your userform.

Sub ShowQuestionnaire()
Dim myForm As frmAddress
Set myForm = New frmAddress
myForm.Show
Unload myForm
Set myForm = Nothing
End Sub

In the example above, frmAddress is the name of the form. The macro
ShowQuestionnaire would show up in the macro list.


See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying customizations including
AutoText, AutoCorrect, keyboard assignments, macros, etc.
 
B

benji

thanks thats what I needed

-----Original Message-----
You need a separate macro in a module or in the This Document component that
activates your userform.

Sub ShowQuestionnaire()
Dim myForm As frmAddress
Set myForm = New frmAddress
myForm.Show
Unload myForm
Set myForm = Nothing
End Sub

In the example above, frmAddress is the name of the form. The macro
ShowQuestionnaire would show up in the macro list.


See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying customizations including
AutoText, AutoCorrect, keyboard assignments, macros, etc.


--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ------- --
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

and I wrote the
code this template to
the


.
 

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