Outlook email blank subject warning

Xavier Mustin

Administrator
Staff member
#1
Ever now and so often, it happens that I forget filling in the mail subject when composing an email in Outlook (typically when I have to send a rather important email…).

Save yourself the annoyance by following the next steps.


  1. Open the Visual Basic Editor (in Outlook, press ALT+F11).
  2. On the left-hand side of the screen, expand the ‘Project1′ (go into ‘Microsoft Office Outlook Objects’ -> ‘ThisOutlookSession’).
  3. Double click on ‘ThisOutlookSession’
  4. Paste the following lines of code in the right-hand pane of the screen:
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If Item.Subject = "" Then
Cancel = MsgBox("This message does not have a subject." & vbNewLine & "Do you wish to continue sending anyway?", vbYesNo + vbExclamation, "No Subject") = vbNo
End If

End Sub
Save the project (‘File’ -> ‘Save’) and return to Outlook. From now on, the code will be called every time you press the send-button after you composed an email. Outlook will pop up a warning when you try sending an email with an empty subject line.

The code has been tested on Outlook 2003 and 2007.
 
Haut