I am creating an Outlook VSTO that allows users to enter information in an additional form-region on the New appointment form. When sending the appointment I would like to capture the 'Send' event and perform some checks on the data the user provided. When this data is OK the appointment can be send, otherwise the Send action must be cancelled.
My code is like this:
Dim apptItem as Outlook.AppointmentItem
Private Sub Test_FormRegionShowing(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.FormRegionShowing
apptItem = OutlookItem
AddHandler apptItem.Send, AddressOf sendAppt
End Sub
Private Sub sendAppt()
If some_test = False then
else
Cancel=True
End If
End Sub
How do I pass the event arguments to my SendAppt function so that I can cancel out of the routine and prevent the meeting from being send?