A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Appointment in Calendar help - Event triggers - Visual basic



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 11th 08, 08:04 PM posted to microsoft.public.outlook.program_vba
kneel
external usenet poster
 
Posts: 6
Default 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
Ads
  #2  
Old January 11th 08, 09:20 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default 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

  #3  
Old January 11th 08, 09:40 PM posted to microsoft.public.outlook.program_vba
kneel
external usenet poster
 
Posts: 6
Default 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/


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In Visual Basic, how do I access the Calendar Label color for appt D2SRJ Outlook and VBA 1 October 26th 06 01:11 AM
MS Visual Basic error in Outlook XP User Outlook - General Queries 3 May 7th 06 01:45 PM
Visual Basic and OE [email protected] Outlook Express 1 February 8th 06 02:35 PM
Visual Basic Editor opens automatically [email protected] Outlook and VBA 0 February 6th 06 05:53 PM
how do Visual Basic Application (VBA) commands work Jason Outlook and VBA 2 January 10th 06 10:50 AM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.