Microsoft Outlook Attachment Reminder

This Outlook macro will politely remind you to attach a file if it finds the word “attach” in your email and no actual attached file.

In Outlook, go to Tools > Macro > Visual Basic Editor and expand the project by clicking the plus signs under Project1 until you see ThisOutlookSession – and double-click it. Copy-paste the code below in the empty page.

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 
		'Change 0 below, to number of files in 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

Click Save and and ensure macros aren’t disabled (if previously disabled).