Deleting emails AFTER sending

N

Nigel RS

I am using the following to email workbooks, which works great. I recently
added DeleteAfterSubmit = True; this works to remove the emails from the SENT
items folder and places them into the DELETED items folder. Is there a way to
delete them completely?

Sub MailWorkbook()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "(e-mail address removed)"
.Subject = "New Report"
.Body = "New report attached to this email"
.Attachments.Add ActiveWorkbook.FullName
.DeleteAfterSubmit = True
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top