![]() |
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
|
|||
|
|||
![]()
I wan't to have something like this:
I add items to Items collection and I do not wan't to handle the event (at startup) and after I add some of those items I wan't to start handling the ItemAdd event. My code looks like this: class Folder { private Outlook.Folder _folder = null; private Outlook.Items _items = null; private Logic.ContactsLogic _contactsLogic = null; public Folder(Outlook.NameSpace outlook, string folderName) { Outlook.Folder defaultCalendarFolder = (Outlook.Folder)outlook.GetDefaultFolder(Outlook.O lDefaultFolders.olFolderContacts); _folder = GetFolder(defaultCalendarFolder, folderName); _items = _folder.Items; _contactsLogic = new ContactsLogic(); // In here I add some items to the folder _contactsLogic.SynchronizeContacts(this); HookUpEvents(); } private void HookUpEvents() { _folder.BeforeFolderMove += new Microsoft.Office.Interop.Outlook.MAPIFolderEvents_ 12_BeforeFolderMoveEventHandler(Folder_BeforeFolde rMove); _folder.BeforeItemMove += new Microsoft.Office.Interop.Outlook.MAPIFolderEvents_ 12_BeforeItemMoveEventHandler(Folder_BeforeItemMov e); _items.ItemAdd += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd); _items.ItemChange += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemC hangeEventHandler(Items_ItemChange); _eventsHookedUp = true; } } Although I add event handlers after I add the Items to the collection (in statement _contactsLogic.SynchronizeContacts(this); ) I still get to handle them in Items_ItemAdd and I don't wan't to |
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 |
ItemAdd in Deleted Items event doesnt fire after a while | [email protected] | Add-ins for Outlook | 11 | January 8th 07 08:27 AM |
ItemAdd in Deleted Items event doesnt fire after a while | SHUperb | Outlook - Calandaring | 0 | January 5th 07 07:41 AM |
How to put the EventHandler ItemAdd to all open Deleted Items Folder's | Ralf Preis | Outlook and VBA | 1 | May 18th 06 04:35 PM |
ItemAdd | BlockNinja | Outlook and VBA | 1 | March 23rd 06 04:49 AM |