Add action to submit button??

M

MaryC

How do I add an action to a command button that I want to use to submit the form results (i.e., send the form message via e-mail to the e-mail address that appears in the To field on the form)?
 
S

Sue Mosher [MVP]

Use the Click event:

Sub CommandButton1_Click()
' your code goes here
End SUb
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
M

MaryC

Hi, Sue

When I choose View Code, the first line in the Script Editor say

sub submit_click(

The name of the submit button is "submit"

I do not know what code to put in to get the button to send the message - although at the bottom of the Script Editor window after a lot of code about object controls, etc., it say

Function Item_Send (
item.messageClass = "IPM.Note.CapitalMarketsIntranetInformation
End Functio

This is actually a form that someone else at my company designed and could not get to work properly. The submit button does not send the form and we are trying to find out why

Thanks for your help

MaryC
 
S

Sue Mosher [MVP]

If the Properties dialog for the form says the name (not the caption) of the button is Submit, this will send the item where the code is running:

Sub Submit_Click()
Item.Send
End Sub

If you already have code in this procedure, please post it. If you can't tell whether it's running or not, add this statement:

MsgBox "I am running"

to the Submit_Click procedure, increment the version number on the (Properties) tab, republish the form, and try it again with a new item. If it does not work then, please provide information on where the form is published and your Outlook version.

The code you cited in your message connects the message to a custom form named IPM.Note.CapitalMarketsIntranetInformation when the item is sent.

Please take the time to quote the original message manually so that people reading your current response can understand what you're talking about. Otherwise, you may not receive the answer you're looking for.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

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