gena
August 12th, 2001, 07:19 AM
Hi!
I wonder if there is the way to trace/prevent moving items in Outlook COM AddIn?
The thing is that the ItemRemove event in source Items collection is fired up when the item is already removed. And I think it is practically impossible to track the AddItem event in all possible destinations.
I thought that I've found the work around. In SelectionChange event I created the Selection object, so when ItemRemove is up, I had the IDs of deleted items. So what further? Find message(s) by EntryID (GetItemFromID), find parent folder, remove from it and add to the source folder. Fudge!!! EntryID provided is so called "short-term identifier" and changes when the item is moved to another folder. And more !! I tried to use CDO Message object. How I can relate the MailItem and Message objects? I decided to use Session.GetMassage(EntryID). But found CDO message also returned the same short-term identifier in ID property.
So my questions:
1. Is there any standard technic to do what I need?
2. If not, may be somebody knows how to get the permanent message ID using MailItem object (deleted or not - doesn't matter).
Sorry for long story.
Thanks in advance.
Regards,
Gennady
I wonder if there is the way to trace/prevent moving items in Outlook COM AddIn?
The thing is that the ItemRemove event in source Items collection is fired up when the item is already removed. And I think it is practically impossible to track the AddItem event in all possible destinations.
I thought that I've found the work around. In SelectionChange event I created the Selection object, so when ItemRemove is up, I had the IDs of deleted items. So what further? Find message(s) by EntryID (GetItemFromID), find parent folder, remove from it and add to the source folder. Fudge!!! EntryID provided is so called "short-term identifier" and changes when the item is moved to another folder. And more !! I tried to use CDO Message object. How I can relate the MailItem and Message objects? I decided to use Session.GetMassage(EntryID). But found CDO message also returned the same short-term identifier in ID property.
So my questions:
1. Is there any standard technic to do what I need?
2. If not, may be somebody knows how to get the permanent message ID using MailItem object (deleted or not - doesn't matter).
Sorry for long story.
Thanks in advance.
Regards,
Gennady