J
Jim Burke in Novi
My events for appointment items being added or changed aren't always
triggered when I add or change an appointment. Sometimes, after I start a
session , they don't tirgger at all, and I have to restart (sometimes more
than once) before they'll get triggered. And if I make VBA coding changes
this seems to cause them not to be trigerred also. There must be somethiing I
don't understand about Outlook's programming envrionment. I know the events
aren't being triggered because I'll put break points on the very first
statement in both events and they never get reached. Here is the code I have
in ThisOutlookSession for my events (I checked in the code to see if my
WithEvents variable is ever reset anywhere and it's not)...
Public WithEvents m_colCalItems As Outlook.Items
Public Sub m_colCalItems_ItemAdd(ByVal item As Object)
If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If
End Sub
Public Sub m_colCalItems_ItemChange(ByVal item As Object)
If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If
End Sub
Private Sub Application_Startup()
Set m_colCalItems =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
End Sub
triggered when I add or change an appointment. Sometimes, after I start a
session , they don't tirgger at all, and I have to restart (sometimes more
than once) before they'll get triggered. And if I make VBA coding changes
this seems to cause them not to be trigerred also. There must be somethiing I
don't understand about Outlook's programming envrionment. I know the events
aren't being triggered because I'll put break points on the very first
statement in both events and they never get reached. Here is the code I have
in ThisOutlookSession for my events (I checked in the code to see if my
WithEvents variable is ever reset anywhere and it's not)...
Public WithEvents m_colCalItems As Outlook.Items
Public Sub m_colCalItems_ItemAdd(ByVal item As Object)
If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If
End Sub
Public Sub m_colCalItems_ItemChange(ByVal item As Object)
If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If
End Sub
Private Sub Application_Startup()
Set m_colCalItems =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
End Sub