Search Bluebook IT Support Website

Warn About Missing Attachment In Outlook 2010

When you use Outlook 2010 and older, you need to use VBA or an add-in to warn about missing attachments.

The following macro needs to go in ThisOutlookSession and runs when the message is sent. If it finds the word “attach” in the message body, it triggers a warning dialog.

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

Dim EndOfMsg, WordAttach As Integer

EndOfMsg = InStr(1, Item.Body, "From:")

WordAttach = InStr(1, Item.Body, "attach", vbTextCompare)

If WordAttach > 0 And WordAttach < EndOfMsg Then

    If Item.Attachments.Count = 0 Then

      answer = MsgBox("There's no attachment, send anyway?", vbYesNo)

      If answer = vbNo Then Cancel = True

    End If

ElseIf EndOfMsg = 0 And WordAttach > 0 Then

    If Item.Attachments.Count = 0 Then

      answer = MsgBox("There's no attachment, send anyway?", vbYesNo)

      If answer = vbNo Then Cancel = True

    End If

End If

End Sub