How does one find out that an item is deleted? (all Outlook Versio

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know I must be missing something really obvious, but how does one
programatically find out if a particular item has been deleted? For example,
I retrieve my items in Outlook in the following manner:

gOutlookItem = gOutlookNamespace.GetItemFromID(strEntryID, strStoreID)

That retrieves the item into the gOutlookItem. However, how do I find out if
this item has been deleted?

One strategy I use is to check if the gOutlookItem.Parent.Name is "Deleted
Items", however that only works on English installations of Outlook. In other
countries, "Deleted Items" is a different name. So that fails.

Hence, is there a flag or property on the gOutlookItem that indicates that
it is deleted, or is there a property or class in the deleted items folder
that indicates that it contains "Deleted Items"?

Thanx you in advance for any hints on how to deal with my conundrum....
 
The technically correct way to do that would be use the Store object and
read property PR_IPM_WASTEBASKET_ENTRYID (0x35E30102), a PT_BINARY property
that contains the EntryID of the Deleted Items folder. You then take that
EntryID and compare it to the Parent.EntryID of the item to see if it's in
Deleted Items. For the comparison you would use a CompareIDs method, since
that takes into account any differences between short-term and long-term
ID's in an Exchange setting.

To do that of course you would need Outlook 2007 or a low level API such as
CDO 1.21 or Redemption, something that can get at properties that aren't in
the Outlook object model.
 
Ken,

Thanx for the info. I just tried it and it works like a charm.
It's been a while since I've done hexadecimal decoding but I managed
to figure it out.

Thanx a lot.

T
 
Back
Top