Solved

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

Posted on 2003-10-22
3
323 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
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
outlook 2013 3 48
Rename the Clutter folder in Office365 3 78
Exchange 2016 Autodiscover-Outlook 2013 3 76
Add a signature to Shared mailbox Exchange 2010 3 37
Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

919 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now