AppointmentItem BeforeDelete Event

K

Khyati

We are using Outlook to schedule web conferences and using outlook 2003. My
question is regarding the BeforeDelete event. BeforeDelete Event has been
coded in .net(2003) code behind using vb.net. when I right click on a
scheduled meeting on the calendar and click on delete, it rarely goes to the
BefreDelete event in code behind. So it just delete the meeting from the
calendar and meeting is still in there in our SQL database as it doesnt go to
BeforeDelete Even where the delete functionality has beeen coded. Could you
please help me on this.
 
J

John Guin

when you save "rarely" for the delete event firing, do you mean "the event
fires but not consistently" or "the event never fires?"

If not consistently, have you made a list of variables on the occasions on
which it does not fire (like it never fires on the slowest machine we use, it
only fires when I step through the code in the debugger, it never fires if I
have some certain addin installed, etc...)

If that process help narrow it down, please post which .net framework you
are using, the relevant code, Outlook details (exchange server, POP, cached
mode, etc...). Maybe that would help locate the problem.

Thanks,
John
 
K

Khyati

It s really hard to understand. Sometimes it fires on debug mode and
sometimes when not debugging. But sometimes it doesnt fire even on the debug
mode.

My code is:

Private Sub m_olAppointmentItem_BeforeDelete(ByVal Item As Object, ByRef
Cancel As Boolean) Handles m_olAppointmentItem.BeforeDelete
'Only runs the customized codes if it is vMeetingForOutlook form
If m_olAppointmentItem.FormDescription.Name.Trim.ToLower <>
"vMeetingForOutlook".ToLower Then Exit Sub

Try
'm_olAppointmentItem_Open(Cancel)
g_ResID = CType(GetOutlookProperty(m_olAppointmentItem,
"ResID").Value, Integer)
g_bIsMCUAppointment =
CType(GetOutlookProperty(m_olAppointmentItem, "IsMCUAppointment").Value,
Boolean)
g_bIsReservationlessLookup =
CType(GetOutlookProperty(m_olAppointmentItem, "IsMeetingRoom").Value, Boolean)
If Not g_bIsReservationlessLookup Then
System.Windows.Forms.Application.DoEvents()
Common.ErrorHandler.Log("m_olAppointmentItem_BeforeDelete",
"")
GetOutlookProperty(m_olAppointmentItem,
"IsMCUAppointment").Value = False
Cancel = Not XMLAppointment()
End If
Catch ex As COMException
SendErrorDetails(ex.ToString.Trim,
"m_olAppointmentItem_BeforeDelete - (COMException) ")
Common.ErrorHandler.HandleException(ex)
Cancel = True
Catch ex As System.Exception
SendErrorDetails(ex.ToString.Trim,
"m_olAppointmentItem_BeforeDelete")
Common.ErrorHandler.HandleException(ex)
Cancel = True
End Try
End Sub

We are using .net framework 1.1 and outlook 2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top