• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2948
  • Last Modified:

Automatically Delete last email sent from Outlook with Excel VBA

Need to delete the last email sent from MS Outlook from excel using VBA.
1 Solution
Chris BottomleyCommented:
Please note that the outlook topic would probably help here!

That said sent email can be saved with the received emails as well as in the sent items folder which would complicate matters so can you clarify what is happening so we can try and provide appropriate help?

Berkson WeinTech FreelancerCommented:
It would help immensely if you provided the code that you're using to create the email in the first place (Assuming that's what you're doing).  

If you're creating a mail object in vba, set DeleteAfterSubmit to true, which would stop it from going to sent items in the first place.  For example:

Set OutApp = CreateObject("Outlook.Application") 
Set OutMail = OutApp.CreateItem(0) 

With OutMail 
            .To =
            .Subject = 
            .Body =  
            .DeleteAfterSubmit = True   <----  don't save it in outlook
End With 

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now