Attachment reminder for Microsoft Outlook

Wouldn't it be nice if Outlook reminded you if you forgot to include an attachment in your email?

outlook-attachment

To achieve this we need to add a VBA macro to Outlook. Simply follow the instructions below and you’ll never have to send another embarrassing “Oops, here’s the attachment that I forgot” emails again!

  1. In outlook, open the Tools menu, navigate down to Macro and then select Visual Basic Editor
  2. Expand the project (on the left at the top) until you see ThisOutlookSession.
  3. Double-click on ThisOutlookSession and paste the code below into the editor window.
  4. Click the Save icon and then close the entire editor window.

The Code

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

    Dim m As Variant
    Dim strBody As String
    Dim intIn As Long
    Dim intAttachCount As Integer, intStandardAttachCount As Integer
    On Error GoTo handleError

    ' Edit the following line if you have a signature on your email that
    ' includes images or other files. Make intStandardAttachCount equal to
    ' the number of files in your signature.
    intStandardAttachCount = 0

    strBody = LCase(Item.Body)
    intIn = InStr(1, strBody, "original message")

    If intIn = 0 Then intIn = Len(strBody)

    intIn = InStr(1, Left(strBody, intIn), "attach")
    intAttachCount = Item.Attachments.Count

    If intIn > 0 And intAttachCount <= intStandardAttachCount Then
        m = MsgBox("It appears that you mean to send an attachment," & vbCrLf & "but there is no attachment to this message." & vbCrLf & vbCrLf & "Do you still want to send?", vbQuestion + vbYesNo + vbMsgBoxSetForeground)
        If m = vbNo Then Cancel = True
    End If

handleError:

    If Err.Number <> 0 Then
        MsgBox "Outlook Attachment Reminder Error: " & Err.Description, vbExclamation, "Outlook Attachment Reminder Error"
    End If

End Sub

This Outlook VB script was originally created by LifeHacker commenter Jack Stowage and then modified by Troy (no last name provided).