PC Review


Reply
Thread Tools Rate Thread

AppointmentItem.PropertyChange event not fired

 
 
Sunny
Guest
Posts: n/a
 
      20th Nov 2003
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

 
Reply With Quote
 
 
 
 
Sunny
Guest
Posts: n/a
 
      21st Nov 2003
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
 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      21st Nov 2003
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


"Sunny" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Sunny
Guest
Posts: n/a
 
      24th Nov 2003
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
 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      24th Nov 2003
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


"Sunny" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Sunny
Guest
Posts: n/a
 
      24th Nov 2003
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

In article <(E-Mail Removed)>, (E-Mail Removed)
says...
> 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
>
>
>

 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      24th Nov 2003
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


"Sunny" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> In article <(E-Mail Removed)>, (E-Mail Removed)
> says...
> > 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
> >
> >
> >



 
Reply With Quote
 
Sunny
Guest
Posts: n/a
 
      25th Nov 2003
Ok, thanks Dmitry,
not what I wanted, but it seems that I'll run a background process to
inspect the deleted items.

Thanks
Sunny

In article <(E-Mail Removed)>, (E-Mail Removed)
says...
> 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
>
>
> "Sunny" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> > In article <(E-Mail Removed)>, (E-Mail Removed)
> > says...
> > > 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
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AppointmentItem BeforeDelete Event =?Utf-8?B?S2h5YXRp?= Microsoft Outlook Form Programming 2 28th Jun 2007 03:10 AM
PropertyChange event can not detect changes in Body? =?Utf-8?B?aml1bg==?= Microsoft Outlook VBA Programming 1 23rd Dec 2006 09:12 AM
AppointmentItem Change Event David C. Holley Microsoft Outlook VBA Programming 13 11th Aug 2005 09:25 PM
PropertyChange/Custom PropertyChange mookashi Microsoft Outlook VBA Programming 1 10th Feb 2004 12:05 PM
why is PropertyChange event not fired for Item.Body Michael.Kensy Microsoft Outlook VBA Programming 0 1st Sep 2003 12:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:28 PM.