Appointment in Calendar help - Event triggers - Visual basic



I've added an event handler to trigger when a new appointment is added into
my calendar. This works. However, when a new appointment is viewed in a
preview pane in an inbox folder, this event is also triggered as Outlook
appears to move a 'tentative' appointment into the calendar before the user
has accepted,tentative or declined.

My question is, how can I distinguish the difference? ( Basically I only
want to trap on the USERS action of accepting or tentative.

Any help appreciated.. Thanks

My event handler looks like this..

Public WithEvents myOlItems As Outlook.Items

Private Sub Application_Startup()
Set objNS = Application.GetNamespace("MAPI")
Set fld = objNS.PickFolder
If Not fld Is Nothing Then
Set myOlItems = fld.Items
End If
End Sub

Private Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim incomingAppt As Outlook.AppointmentItem
MsgBox "you just added an item"
End Sub

Eric Legault [MVP - Outlook]

I think the easiest option would be to monitor the ItemChange event in an
Items collection retrieved from the Calendar folder and check the
ResponseStatus property.

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