Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Appointment in Calendar help - Event triggers - Visual basic (http://www.outlookbanter.com/outlook-vba/64930-appointment-calendar-help-event-triggers.html)

kneel January 11th 08 07:04 PM

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
Neil


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] January 11th 08 08:20 PM

Appointment in Calendar help - Event triggers - Visual basic
 
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.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"kneel" wrote:

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
Neil


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


kneel January 11th 08 08:40 PM

Appointment in Calendar help - Event triggers - Visual basic
 
Perfect, this is the exact help I needed!! Thanks again!

"Eric Legault [MVP - Outlook]" wrote:

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.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/




All times are GMT +1. The time now is 05:59 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com