VBOffice

Send and Delete Email

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

Last modified: 2006/12/06 | Accessed: 72.100  | #38
◀ Previous sample Next sample ▶
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.

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
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
email  Send a message