I put this code in a private sub and it does not work when i click the button
Private Sub Commande0_Click() MsgBox "allo le monde" End Sub
and this code either does not work
Private Sub Commande1_Click()
Dim OObj As Outlook.Application Dim OMsg As Outlook.MailItem
Set OObj = CreateObject("Outlook.Application") Set OMsg = OObj.CreateItem(olMailItem)
OMsg.To = "[email protected]" OMsg.Subject = "This is the subject" OMsg.Body = "This is the body"
OMsg.Display
Set OMsg = Nothing Set OObj = Nothing
End Sub
What is wrong ?
Reply from Alex Hedley:
How did you create the button event? If you open the Form in Design View, click on the button and open the Properties Sheet, is there an event in the Click? You need to link the button to the code, it may not be. If you but a breakpoint in the sub does it hit?
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.