Solved

Randomly executes Item.delete for mailitems in Inbox - processing delivery receipts

Posted on 2003-10-22
3
326 Views
Last Modified: 2012-05-04
a)
I have a module (in an access database, but attaches to outlook) that is supposed to process delivery receipts, ultimately to report on end user experience of performance of mail delivery to our various email servers around the world. Mails are automatically sent regularily, with delivery receipt required. Now and again, a module runs from MSaccess that reads all the delivery receipts in the inbox, as this forces the updating of the tracking tab status fields in the sent mail folder.  The first part of the module below searches the inbox for delivery receipts, opens them, and deletes them. This processes the tracking status tab. However it seems to randomly process them. You run it a few times and it gets them all.. but why doesn't it get them all first time?

Set myitems = myfolder.Items.Restrict("[messageclass]='REPORT.IPM.note.DR'")
    For Each Item In myitems
            Item.Display
            Item.Close (olDiscard)
            Item.Delete
    Next

b) Also ... The trackingStatusTime field in the Recipients Object is overwritten by the latest tracking event, so a read receipt would override a delivery receipt. Yet the tracking tab in the sent mail folder shows both read and delivery times, so they must both be stored somewhere. Any idea where I might be able to locate them ?
0
Comment
Question by:brucemcpherson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:brucemcpherson
ID: 9605796
Found the answer to a) on MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnout2k2/html/odc_oldevsol.asp

this now works... you have to go through the collection backwords when deleting..

Set myitems = myfolder.Items.Restrict("[messageclass]='REPORT.IPM.note.DR'")
' becuase deleting an item changes the collection -- you have to go through it backwards
    numitems = myitems.Count
    For i = numitems To 1 Step -1
            Set curItem = myitems(i)
            curItem.Display
            curItem.Close (olDiscard)
            curItem.Delete
    Next
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10600452
PAQed, with points refunded (125)

GhostMod
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Read this checklist to learn more about the 15 things you should never include in an email signature.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question