![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Dear Reader,
I figured out that the ItemAdd event fires more than once when I add a new appointment to the calendar in Outlook 2003! After a couple of ItemAdd events one ItemChanged event is fired! It also seems that when there are more items in the calendar, more ItemAdd events will be fired... Does anyone know the cause of this strange behaviour and the solution? Here's the code snippet which is executed in the OnStartupComplete() method of my add-in: Outlook.Application application = (Microsoft.Office.Interop.Outlook.Application)appl icationObject; Outlook.NameSpace mapiNamespace = application.GetNamespace("MAPI"); Outlook.MAPIFolder calendarFolder = mapiNamespace.GetDefaultFolder(Outlook.OlDefaultFo lders.olFolderCalendar); calendarFolder.Items.ItemAdd += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd); calendarFolder.Items.ItemChange += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemC hangeEventHandler(Items_ItemChange); Thank you in advance! Johan Machielse Avanade |
#2
|
|||
|
|||
![]()
Already solved; I added the handler to the event at two places!
"Johan Machielse" wrote: Dear Reader, I figured out that the ItemAdd event fires more than once when I add a new appointment to the calendar in Outlook 2003! After a couple of ItemAdd events one ItemChanged event is fired! It also seems that when there are more items in the calendar, more ItemAdd events will be fired... Does anyone know the cause of this strange behaviour and the solution? Here's the code snippet which is executed in the OnStartupComplete() method of my add-in: Outlook.Application application = (Microsoft.Office.Interop.Outlook.Application)appl icationObject; Outlook.NameSpace mapiNamespace = application.GetNamespace("MAPI"); Outlook.MAPIFolder calendarFolder = mapiNamespace.GetDefaultFolder(Outlook.OlDefaultFo lders.olFolderCalendar); calendarFolder.Items.ItemAdd += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd); calendarFolder.Items.ItemChange += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemC hangeEventHandler(Items_ItemChange); Thank you in advance! Johan Machielse Avanade |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
(VSTO SE) folder.Items.ItemAdd Event does not fire | David | Outlook and VBA | 5 | March 7th 07 08:41 PM |
event echo (event fires twice) vba/vb | smanky | Outlook and VBA | 0 | November 9th 06 01:16 PM |
Explorer closing before Item Add event fires?? | AndyK | Outlook and VBA | 3 | November 3rd 06 02:22 PM |
Problem with CommandBarComboBox Change Event (Event fires only once) | M. Khalid Farooq | Add-ins for Outlook | 1 | October 19th 06 02:34 PM |
ItemAdd event with Outlook2007 | DavidH&P | Outlook - Using Forms | 2 | July 4th 06 08:29 AM |