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 / October 2006

Tip: Looking for answers? Try searching our database.

Toolbar button for Userform?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ithaca - 15 Oct 2006 16:24 GMT
I'm trying to create a custom button to call a macro that runs via userform
but have been unsuccessful.  I can create a button to call the related macro
but I need the actual userform to be called.  is there a way to do this?

Also, is there a way to distribute this button to others that may need it?  
Or will I have to create it on each computer individually?

Thanks in advance for any help!

-Ithaca
Doug Robbins - Word MVP - 15 Oct 2006 16:44 GMT
To get the userform to be displayed, you need to have your button run a
macro that contains code of the following form:

  Dim MyDlg As MyUserForm
  Set MyDlg = New MyUserForm
  MyDlg.Show
  Set MyDlg = Nothing

Where MyUserForm is the name assigned to your UserForm.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I'm trying to create a custom button to call a macro that runs via
> userform
[quoted text clipped - 8 lines]
>
> -Ithaca
Ithaca - 15 Oct 2006 18:33 GMT
Thanks a lot Doug!  That works perfectly.  

I want to set up this macro and custom button on multiple users computers
here at work so is there an easier way than manually doing so to each
computer?

> To get the userform to be displayed, you need to have your button run a
> macro that contains code of the following form:
[quoted text clipped - 5 lines]
>
> Where MyUserForm is the name assigned to your UserForm.
Jay Freedman - 15 Oct 2006 18:35 GMT
And for distributing the button, macro, and userform (all in the same
template) to other users, see
http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>To get the userform to be displayed, you need to have your button run a
>macro that contains code of the following form:
[quoted text clipped - 18 lines]
>>
>> -Ithaca
Ithaca - 16 Oct 2006 00:09 GMT
so if I create a new template I can just email it and copy it to the user's
Word startup file?  and my buttons and everything will be there??

> And for distributing the button, macro, and userform (all in the same
> template) to other users, see
[quoted text clipped - 29 lines]
> >>
> >> -Ithaca
Jay Freedman - 16 Oct 2006 01:59 GMT
Right. The hardest part is getting the user to put the file in the
correct folder. Since it's marked as a hidden folder, most people need
to be shown how to set Windows Explorer to let them see it.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>so if I create a new template I can just email it and copy it to the user's
>Word startup file?  and my buttons and everything will be there??
[quoted text clipped - 32 lines]
>> >>
>> >> -Ithaca
Ithaca - 16 Oct 2006 03:54 GMT
Ha!  I think I'll be setting it up since it's only like five computers...  
Eliminate at least some of the error in the process, but there's no way to
eliminate my own errors :D

Thanks Jay and Doug!!!

> Right. The hardest part is getting the user to put the file in the
> correct folder. Since it's marked as a hidden folder, most people need
[quoted text clipped - 6 lines]
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.

Rate this thread:






 
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.