A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 12th 07, 05:38 PM posted to microsoft.public.outlook.program_vba
Thatch
external usenet poster
 
Posts: 23
Default How does one find out that an item is deleted? (all Outlook Versio

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....
  #2  
Old July 12th 07, 08:06 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How does one find out that an item is deleted? (all Outlook Versio

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 Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Thatch" wrote in message
...
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....


  #3  
Old July 13th 07, 06:10 AM posted to microsoft.public.outlook.program_vba
Thatch
external usenet poster
 
Posts: 23
Default How does one find out that an item is deleted? (all Outlook Ve

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

"Ken Slovak - [MVP - Outlook]" wrote:

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 Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Thatch" wrote in message
...
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....



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't delete emails from deleted item folder in OUTLOOK 2007? David Outlook - General Queries 2 June 10th 07 12:42 AM
What is the Upgrade costs of Office 2003. I have the Trial Versio Bryon Outlook - General Queries 2 August 29th 06 01:48 AM
How to Find a Item using VBScript in Outlook/Exchange Andrew Sampels Outlook - Using Forms 5 August 8th 06 10:54 PM
I cannot empty deleted item in Outlook gary Outlook - Installation 3 April 24th 06 01:37 AM
lost all old messages and address book during update to oe6 versio scott77777 Outlook Express 1 March 16th 06 01:40 AM


All times are GMT +1. The time now is 09:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.