View Single Post
  #4  
Old October 15th 06, 12:42 AM posted to microsoft.public.outlook.program_vba
Geoff
external usenet poster
 
Posts: 21
Default Deleting Duplicate Mailitems

Hi Ken,

I'm making great progress thanks to your earlier help!

I have a couple of more questions, if I may.

Using VBA and CDO 1.21 in Outlook, I'm sending a MAPI.Fields collection for
an Outlook Mailitem to a function containing the following code:

Dim lngValue as Long
lngValue = &H10810003
Set objOneField = objMAPIFieldsColl.item(lngValue)

As you mentioned, if the Mailitem has been replied to, then
objOneField.Value is 102.

If the Mailitem has not been replied to, the last code line above generates
a run-time error.

My questions a

1. Am I right in assuming that the run-time error occurs because, when a
Mailitem has not been replied to, the field in question simply does not
exist? Can I trap the error and assume that the Mailitem has not been
replied to?

2. If a run-time error is not generated, I then get access to the field.
Do I have to ensure that its Value property is 102 before I can assume that
the Mailitem has been replied to? I'm wondering if the Value property could
contain other values that would mean other things.

Very many thanks for getting me this far.
Regards
Geoff


"Ken Slovak - [MVP - Outlook]" wrote in message
...
The property you're looking for isn't exposed in the Outlook object model.
It's in PR_LAST_VERB_EXECUTED (0x10810003), where replied to is 102. You'd
need to be using CDO 1.21 or Extended MAPI or a MAPI wrapper such as
Redemption (www.dimastr.com/redemption) to get at it.

--
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


"Geoff" wrote in message
...
Which Mailitem property stores the fact that a received Mailitem has been
replied to?

I need to distinguish programatically between duplicate Mailitems:

1. Some mailitems show "You replied on ... Click here to find all
related messages".
2. Duplicate mailitems in the same folder are exactly the same except
they do not show the above message.

I have written a VBA program that scans thousands of emails in multiple
stores and folders. The program finds duplicate Mailitems in the same
folder (by comparing SenderName, To, ReceivedTime, SentOn, Subject and
Attachments.Count). I want to delete the duplicates that don't show the
"You replied on..." message. I hope there's a property that stores this
"replied" information. Does it exist? Is there a way to distinguish?

TIA
Geoff



Ads