AppointmentItem.PropertyChange event not fired

S

Sunny

Hi,
I have C#/VS.Net 2003 addin for Outlook 2000.
Everything works so far (hard, a lot of workarounds :) ) but works.
No I have the following problem:
I try (successfully) to capture the PropertyChange event. It works if I
change (programmatically or by user entry) EntryID, Subject, Body, etc.,
but it does not fire when the item is moved to another folder. My goal
is to capture the manual deletion of the item, so I'll be able to clear
behind :), and also to be sure to remove the item from Deleted Items
also.

Here goes my questions:

1. As I understand, Parent is property, and it changes when you move the
item, so why the event is not fired?

2. Any workarround (I.e. how to capture the delition? )

3. If I need, how to restore the item. I tried to move it back to
Calendar folder, but after that Save fails. What is the safe way to do
this?

Thanks
Sunny
 
S

Sunny

Hi again,
Here is a little addition to these problems, until someone reponds:

I'm storing for future use the EntryIDs of the items I'm interested in a
file for future use (I.e. for easily finding them again).

So if user deletes the item, it goes in Deleted Items, which is separate
MAPI folder.
According the docs: <cite>
Each Outlook item has a field called EntryID, which is a unique ID field
generated by the messaging storage system for use with the MAPI folders
that store the item. It?s important to note that whenever an item is
created in a folder, it?s assigned a new EntryID. This means that the
EntryID field changes if an item is moved to a different folder or if an
item is exported and then imported (even to the same folder).

But ... when later (even after restart) I make:

oCalendar = myNameSpace.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderCalendar);
_storeID = string _storeId = oCalendar.StoreID;

myItem = GetItemFromID(_savedID, StoreID);

I can still find that item. In order to avoid this, I have to check for
item's parent name, and to check if it is "deleted items".

Why this happens? IMHO I have to receive null in that situation, as the
item is no longer in Calendar folder. Even if the EntryID is not changed
(but it should), the StoreID have to be definitelyy different?

Thanks,
Sunny
 
D

Dmitry Streblechenko

Entry id does not change after an item is moved under a PST provider. Just a
peculiarity of that particular provider.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

Sunny

Thanks Dmitry,
I was not aware that pst is count as one store with one StoreID. Is
there any documets that state this? How are the things in the new
versions of Outlook, as I'm targeting 2000, but I hope that addin will
work with newer versions also.

And, what about tha property change event, my original question? Is it a
bug, or I'm doing something wrong?

Thanks agains
Sunny
 
D

Dmitry Streblechenko

I am not sure what you mean - yes, all PSTs are separate stores each with a
unique store id. My point was that message's entry id does not change when
it is moved under a PST provider, but you should not be relying on that
behavior.
As for the PropertyChange event not firing, there are quite a few cases when
it does not fire; that event is very unreliable.
If you know where the item is being moved, use MAPIFolder.Items.ItemAdd
event instead.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

Sunny

Thanks Dmitry,
the problem is that I want to capture when user deletes the item. This
item is generated by the addin, and I want to control its future :), at
least to unhandle it from the addin.

Thanks
Sunny
 
D

Dmitry Streblechenko

Unless the user uses Shift-Del, the item will go to the Deleted Items
folder, where you can use MAPIFolder.Item.ItemAdd event to see if anything
needs to be done with the item.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

Sunny

Ok, thanks Dmitry,
not what I wanted, but it seems that I'll run a background process to
inspect the deleted items.

Thanks
Sunny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top