Kim, is this a User Form designed through the Outlook VBA editor, or a custom
Outlook form based on one of the standard item types (an e-mail message,
meeting request form, contact, etc.)?
If this is a User Form, then yes - you can double-click the CommandButton
(and other controls that implement events) to display the code editor with an
automatic stub for the control's event automatically created.
However, if this is a custom form, you have to choose "View Code" from the
"Form" menu to view the Script Editor window. The "Event Handler" item from
the "Script" menu has a similar event stub creation mechanism as VBA User
Forms, but for controls you have to manually type the event:
Sub CommandButton1_Click()
'Your code here
End Sub
Assuming that this is a custom form, if you want to automatically address
the outgoing message, set the Item.To property. You can do this in a button
click event, but Item_Open or Item_Send are other good places.
You should also be aware that there are a lot of considerations that you
should take into account when dealing with sending custom forms, especially
over the Internet. This page summarizes the top issues:
Distributing Microsoft Outlook Forms:
http://www.outlookcode.com/d/distributeforms.htm
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job:
http://www.imaginets.com
Blog:
http://blogs.officezealot.com/legault/
"kim" wrote:
> In addition I am trying to add code to a command button using the method in
> an Outlook 2002 book which says double click the command button to get the
> code window. I'm double clicking the button, but nothing happens; am i
> missing something?
>
> "kim" wrote:
>
> > Hi
> > I need to do a custom form. It will have the users click a checbox next to
> > dates they cannot attend events.
> > I was going to type a text field for each day number and put a check box
> > next to it.
> > I then want them to click a send button to send the form back to me.
> > I am not sure of the way to do the send button so that it automatically
> > addresses to me . Sorry if thi s is basic but i am just starting out.
> > Using outlook 2002 on exchange server.
> > nb the invitiation stuff in the calendar will not work for this
> > thanks