Need code to forward message to specific mailbox

L

Lynn Q

Hi, I am a novice and have a form that I would like to have auto-forwarded to
a specific mailbox when the form is completed. I want to have a command
button in the form to click that will perform this forwarding. I would need
all the code to do this including how to link the command button to this
action. (Total novice, but I'm trying). Thanks for your help!
 
E

Eric Legault [MVP - Outlook]

All you need to do is insert a procedure like this in the VBScript editor:

Sub MyCommandButton_Click()
Dim objForwardMail

Set objForwardMail = Item.Forward
objForwardMail.To = "[email protected]"
objForwardMail.Send
End Sub

Where 'MyCommandButton' is the name of the Command Button control on the form.
 
Top