Events not always triggered

G

Guest

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
 
M

Michael Bauer

Am Fri, 27 Jan 2006 08:01:03 -0800 schrieb Jim Burke in Novi:

Jim, at least after code changes it´s clear: Then you really need to start
Outlook again, or place the cursor into the Application_Startup event and
press F5 to run the procedure again.
 

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