?
Solved

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

Posted on 2003-10-22
3
Medium Priority
?
328 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

762 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