G
Guest
I am trying to cancel the sending of an email within my .NET AddIn once the 'Send' button is clicked. I can pick up the 'Send' click event, but the email is sent no matter what I set for the value of Cancel. Below is my code
Private Sub m_olInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) Handles m_olInspectors.NewInspecto
If TypeOf Inspector.CurrentItem Is Outlook.MailItem The
'Must cast to MailItemClass due to "ambiguous name" proble
m_olMailItem = CType(Inspector.CurrentItem, Outlook.MailItemClass
End I
End Su
Private Sub m_olMailItem_Send(ByRef Cancel As Boolean) Handles m_olMailItem.ItemEvents_Event_Send
Tr
Cancel = Tru
Catch ex As Exceptio
ErrorDialog(ex.Message
End Tr
End Su
Is there something wrong with my code? I can get this to work fine in the VBA code, but it ALWAYS sends the email when I try to cancel the send from my .NET Add In
Any help is greatly appreciated.
Private Sub m_olInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) Handles m_olInspectors.NewInspecto
If TypeOf Inspector.CurrentItem Is Outlook.MailItem The
'Must cast to MailItemClass due to "ambiguous name" proble
m_olMailItem = CType(Inspector.CurrentItem, Outlook.MailItemClass
End I
End Su
Private Sub m_olMailItem_Send(ByRef Cancel As Boolean) Handles m_olMailItem.ItemEvents_Event_Send
Tr
Cancel = Tru
Catch ex As Exceptio
ErrorDialog(ex.Message
End Tr
End Su
Is there something wrong with my code? I can get this to work fine in the VBA code, but it ALWAYS sends the email when I try to cancel the send from my .NET Add In
Any help is greatly appreciated.