Today I decided to change one annoyance about Outlook… the fact that it sends out emails immediately and there’s no way to ‘undo’.
I have tried alternatives, like ‘explicit sending’, which results in my forgetting that the email didn’t go out, or using ‘delayed sending’, which is a pain, since you need to do it every time.
Wouldn’t it be better if I could have the option to ‘undo’ sending an email, or just let it be otherwise?
So, I’ve written this quick script in VBA which does just that. In my case, it delays the sending of the email by 5 minutes… if you don’t withdraw it within that time, it simply gets sent… you can change the value to your liking in the code.
To get this done, simply add the following code to your ‘ThisOutlookSession’ class.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Const defaultDelayInMinutes As Integer = 5 Dim timeToSend As Date Dim mi As Outlook.MailItem On Error GoTo ErrorHandler timeToSend = Now + TimeSerial(0, defaultDelayInMinutes, 0) Set mi = Item mi.DeferredDeliveryTime = timeToSend Exit Sub ErrorHandler: MsgBox "Application_ItemSend: " & Err.Description End Sub