M
Manish
I need to register for ItemEvents_10_BeforeDeleteEventHandler,
ItemEvents_10_PropertyChangeEventHandler on any Calendar Event that is
processed by my addin. For any calendar event handled by my addin, I
mainatin the Outlook Id in a database, and also set a user-property on the
outlook appt item.
I know of 2 ways to register for these event handlers for all my calendar
items. Question is which one is better. Can you please provide some insight.
1) On startup complete, I get a list of all calendar folders and iterate
through every item in each of the folders looking for either my user-property
being set, or if the outlook id matches ones in my database. For each such
item, I register the event handlers. Problem I see here is that the add-in
might take too long to load. Im not sure how many months/years of calendar
appts are returned if I called GetDefaultFolder.
2) I register for ExplorerEvents_10_BeforeFolderSwitchEventHandler on all
acitve explorers, and if the ToFolder is of type olAppointmentItem, then I
register for this.Application.ActiveExplorer().SelectionChange += new
Outlook.ExplorerEvents_10_SelectionChangeEventHandler. Then when the user
selects an appointment Item, my callback can check if my user property is
set, and if so register for the property-change and delete event handlers.
problem with this approach is that my callback is being called on every
folder change and also on every item selection in an appointment folder.
Any suggestions on which approach is better? Thanks in advance.
- Manish
ItemEvents_10_PropertyChangeEventHandler on any Calendar Event that is
processed by my addin. For any calendar event handled by my addin, I
mainatin the Outlook Id in a database, and also set a user-property on the
outlook appt item.
I know of 2 ways to register for these event handlers for all my calendar
items. Question is which one is better. Can you please provide some insight.
1) On startup complete, I get a list of all calendar folders and iterate
through every item in each of the folders looking for either my user-property
being set, or if the outlook id matches ones in my database. For each such
item, I register the event handlers. Problem I see here is that the add-in
might take too long to load. Im not sure how many months/years of calendar
appts are returned if I called GetDefaultFolder.
2) I register for ExplorerEvents_10_BeforeFolderSwitchEventHandler on all
acitve explorers, and if the ToFolder is of type olAppointmentItem, then I
register for this.Application.ActiveExplorer().SelectionChange += new
Outlook.ExplorerEvents_10_SelectionChangeEventHandler. Then when the user
selects an appointment Item, my callback can check if my user property is
set, and if so register for the property-change and delete event handlers.
problem with this approach is that my callback is being called on every
folder change and also on every item selection in an appointment folder.
Any suggestions on which approach is better? Thanks in advance.
- Manish