![]() |
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 |
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 |
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