Thread: Events Question
View Single Post
  #5  
Old February 4th 08, 10:49 PM posted to microsoft.public.outlook.program_vba
kalukaley
external usenet poster
 
Posts: 8
Default Events Question

Almost There. I noticed that I didn't include the actual hanlder. The
Inialize_handler is now being called (message box is working).

However, the ItemChange Event doesn't appear to be called.

I have a recurring Appointment in my calendar. as a simple test I change
the duration or start time ( or any other thing ) in the appointment then
save it.
At this point I'm expecting a pop-up from my eventhandler ... but nothing
happens.

P.S. The future of this code is more than just dopey pop-ups


--------------------------------------------------------------------
From CLASS MODULE
-------------------------------------------------------------------
Public WithEvents CalItems As Outlook.items

Public Sub Initialize_handler()

Set CalItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderCalendar).items

MsgBox "I'm here"
End Sub


Public Sub CalItems_ItemChange(ByVal Item As Object)
MsgBox "now I am here"

End Sub

-----------------------------------------------------------------------
From ThisOutLookSession
-----------------------------------------------------------------------
Dim classHandler As New Class1


Private Sub Application_Startup()

classHandler.Initialize_handler



End Sub
"kalukaley" wrote:

Below is a copy of the code that I'm using to catch when someone updates an
item in their calendar.

How would I alter this code to capture an event any appointment in the
calendar.
Also, if one of the appointments is a recurring appointment how do I capture
the update of a single item in the series rather than an update to the entire
series?

Public WithEvents myItem As AppointmentItem

Private Sub Application_Startup()
Set myItem =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderCalendar).Items.GetFirst

End Sub

Private Sub myItem_PropertyChange(ByVal Name As String)
MsgBox "The " & Name & " property changed."
End Sub

Ads