VBOffice

Send and Delete Email

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

Last modified: 2006/12/06 | Accessed: 74.392  | #38
◀ Previous sample Next sample ▶
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.

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
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.
email  Send a message