VBOffice

Send and Delete Email

Send particular emails without saving a copy in your Sent Items folder.

Last modified: 2006/12/06 | Accessed: 32.643  | #38
◀ Previous sample Next sample ▶
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.

Sometimes you send e-mails which don't need to be stored. Via the Options dialog you can determine with four mouse clicks not to store an email - three clicks too much.

From Outlook 2003 on this small VBA sample helps you to save time. Copy the code into 'ThisOutlookSession' and on the email's toolbar create a new button that calls the script. If you want to send an email and store it, then call the standard 'Send' button - but if you don't need to store it, then click the new button, maybe called 'Send And Delete'.

(In principle it works as well for Outlook prior to version 2003. You can avoid the then upcoming security prompt with the Redemption.)


tip  How to add macros to Outlook
Public Sub SendAndDelete()
  Dim obj As Object
  Dim Mail As Outlook.MailItem

  If MsgBox("Delete email?", vbYesNo Or vbQuestion) = vbNo Then
    Exit Sub
  End If

  Set obj = Application.ActiveInspector.CurrentItem
  If TypeOf obj Is Outlook.MailItem Then
    Set Mail = obj
    Mail.DeleteAfterSubmit = True
    Mail.Send
  End If
End Sub
SAM SAM
SAM automatically sets the sending account, or sender address, and folder for sent items based on several criteria.
email  Send a message