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

Events not always triggered



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 27th 06, 04:01 PM posted to microsoft.public.outlook.program_vba
Jim Burke in Novi
external usenet poster
 
Posts: 6
Default Events not always triggered

My events for appointment items being added or changed aren't always
triggered when I add or change an appointment. Sometimes, after I start a
session , they don't tirgger at all, and I have to restart (sometimes more
than once) before they'll get triggered. And if I make VBA coding changes
this seems to cause them not to be trigerred also. There must be somethiing I
don't understand about Outlook's programming envrionment. I know the events
aren't being triggered because I'll put break points on the very first
statement in both events and they never get reached. Here is the code I have
in ThisOutlookSession for my events (I checked in the code to see if my
WithEvents variable is ever reset anywhere and it's not)...

Public WithEvents m_colCalItems As Outlook.Items

Public Sub m_colCalItems_ItemAdd(ByVal item As Object)

If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If

End Sub
Public Sub m_colCalItems_ItemChange(ByVal item As Object)

If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If

End Sub
Private Sub Application_Startup()

Set m_colCalItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderCalendar).Items

End Sub

Ads
  #2  
Old January 30th 06, 06:36 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Events not always triggered

Am Fri, 27 Jan 2006 08:01:03 -0800 schrieb Jim Burke in Novi:

Jim, at least after code changes it´s clear: Then you really need to start
Outlook again, or place the cursor into the Application_Startup event and
press F5 to run the procedure again.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


My events for appointment items being added or changed aren't always
triggered when I add or change an appointment. Sometimes, after I start a
session , they don't tirgger at all, and I have to restart (sometimes more
than once) before they'll get triggered. And if I make VBA coding changes
this seems to cause them not to be trigerred also. There must be

somethiing I
don't understand about Outlook's programming envrionment. I know the

events
aren't being triggered because I'll put break points on the very first
statement in both events and they never get reached. Here is the code I

have
in ThisOutlookSession for my events (I checked in the code to see if my
WithEvents variable is ever reset anywhere and it's not)...

Public WithEvents m_colCalItems As Outlook.Items

Public Sub m_colCalItems_ItemAdd(ByVal item As Object)

If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If

End Sub
Public Sub m_colCalItems_ItemChange(ByVal item As Object)

If item.Class = olAppointment Then
Call ApptAddedOrChanged(item)
End If

End Sub
Private Sub Application_Startup()

Set m_colCalItems =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderCalendar).Items

End Sub

 




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
Why do events dissapear Melsamer Outlook - Calandaring 0 February 27th 06 02:11 PM
Displaying 7+ events across on calendar. DCSloan Outlook - Calandaring 4 February 9th 06 07:51 PM
Copy all events from my old calendar into a new one?? news Outlook - General Queries 1 February 2nd 06 02:55 PM
set up reccurring events sam3136 Outlook - Calandaring 1 January 26th 06 03:01 AM
Scheduled events appear duplicated Zardina Outlook - Calandaring 0 January 18th 06 04:40 PM


All times are GMT +1. The time now is 12:39 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-2025 Outlook Banter.
The comments are property of their posters.