Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a userform 1

Status
Not open for further replies.

Kryzsoccer

Programmer
Oct 15, 2002
85
US
I have just started using VB so this is hopefully an easy question to answer. I am using the VBA with microsoft word and want to know how to mke a commandbutoon that is on the actual word document open a userform(and run its code).

Any help you can give me would be appreciated!
 
VIEW -- Toolbars -- Visual Basic, place the button in the document.

double click on the button, it'll go directly into the code editor

type in the 'sub': userform1.show

*Obviously you'll need to have made the userform, default is called userform1 [yinyang] Tranpkp [pc2]
************************************
- Let me know if this helped/worked!
Please remember to give helpful posts the stars they deserve!
This facilitates others navigating through the threads / posts!
 
I tried this but I recieved an error message saying bad file name or number. I know my userform is called userform1 but it just doesn't seem to work.
 
Oops, my fault. The problem was in my code, I fixed it and it works great.
THANKS A LOT!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top