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 / Outlook / Programming Forms / January 2004

Tip: Looking for answers? Try searching our database.

How to assign code to a command button?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 13 Jan 2004 19:16 GMT
Hello,

I have created an Outlook form, with a command button called cmdSend.

I have also created a sub as below

Sub cmdSend_click
 msgbox "sent"
End Sub

I just can't figure out how to bind the code to the button.  Where
should the code go?

At the moment it is in "ThisOutlookSession" "Application", but this
can't be right as it doesn't run when clicked.

I haven't used Outlook before.  In other office apps there is an
option to assign a macro to a control, but I can't find anything like
that here.
Can anyone explain?

Any help would be very much appreciated.

Many thanks

John
Sue Mosher [MVP] - 13 Jan 2004 19:28 GMT
The code needs to go in the code editor for the custom form. In design mode,
there's a button for View Code.

ThisOutlookSession is for VBA code. Not related to forms at all.
Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Hello,
>
[quoted text clipped - 16 lines]
> that here.
> Can anyone explain?
 
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.