send e-mail code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I’m trying to build a form with build in buttons that will send and close the
form. They have to send the form to a predetermined e-mail and also have to
attend some requirement as the true value of an control. I have written some
codes in vba but they don’t work at all. The thing is that looks like the
buttons is not even linked to the code I wrote, I press it and nothing at all
happened. Here is an example;
My button to this code is named: enviardiretoria

Private Sub enviardiretoria_Click()
If CheckBox1 = True Then
Item.To = "(e-mail address removed)"
Item.Send
End If
If checkbox2 = True Then
Item.To = TextBox21
Item.Send
End If
Close

End Sub

Please help me, thanks in advance
 
I'm confused. Outlook custom forms don't use VBA. THey use VBScript. So where did you actually write your code?

If this is an Outlook form, did you publish it?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
weel I find that out yesterday but still O can't make everything work as I
wanted
to. One of the codes I'm traing to do is supost to send the e-mail to
someone if the checkbox is true or send back to the person that send the form
in the first place if the checkbox is false. The thing is that I can't write
the proper code that make it send back to the person that had send it in the
firt place. here is code I'm tring to use.
Function enviardiretoria_click()
if CheckBox1 = true then
item. to = "(e-mail address removed)"
item.send
end if
if CheckBox1 = false then
item. to = ("de")
item.send
end if
End Function
Thanks
"Sue Mosher [MVP-Outlook]" escreveu:
 
So this is custom form code? You can't just refer to a control as CheckBox1. You must use the proper Outlook syntax, which includes a reference to the page, as described at http://www.outlookcode.com/d/propsyntax.htm#unbound

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Felipe said:
weel I find that out yesterday but still O can't make everything work as I
wanted
to. One of the codes I'm traing to do is supost to send the e-mail to
someone if the checkbox is true or send back to the person that send the form
in the first place if the checkbox is false. The thing is that I can't write
the proper code that make it send back to the person that had send it in the
firt place. here is code I'm tring to use.
Function enviardiretoria_click()
if CheckBox1 = true then
item. to = "(e-mail address removed)"
item.send
end if
if CheckBox1 = false then
item. to = ("de")
item.send
end if
End Function
Thanks
"Sue Mosher [MVP-Outlook]" escreveu:
I'm confused. Outlook custom forms don't use VBA. THey use VBScript. So where did you actually write your code?

If this is an Outlook form, did you publish it?
 
Back
Top