Consulting

Results 1 to 2 of 2

Thread: Is there a way, to delete sent mail from a mailbox, if the mail got delivered?

  1. #1

    Question Is there a way, to delete sent mail from a mailbox, if the mail got delivered?

    Hi guys, I'm new to this board, because this is the first time I have to work with outlook macros.
    And I am relatively new to outlook-vba, but I've figured a few things out, by browsing different forums, and msdn.

    However, there is one thing I haven't found anywhere.

    Is it possible, when a message is sent out with either: requesting a delivery reciept or a read reciept, and you recieve these notification, to delete the subjected mail?

    Each mail has a unique id in their subject, if it helps.

    Thanks in advance,
    Z

  2. #2
    you can try like
    Set myfolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail)
    Set g = myfolder.Items.Restrict("[subject] > 'test'") '   change this to match your subject
    Do While g.Count > 0
        g.Remove 1
    Loop
    test carefully, i am not sure if read receipts are linked to the sent mail, if they are it would probably be better to use that than the subject

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •