<

Avoiding Blank Subject Lines in Outlook

Published on
30,615 Points
18,815 Views
18 Endorsements
Last Modified:
Awarded
Community Pick
Issue.  Have you ever received an email with a blank subject line?  Have you ever clicked "Send" only to realize that you forgot to add a subject?  It’s frustrating to receive a message with no subject.  You’ve no idea what the message is about, how important it is, whether it’s a legitimate message or spam, etc.  It’s even worse to send a message and forget to fill the subject in.  I’ve done it and I always feel foolish afterward.  I can’t help thinking what the recipients think.  This is especially true in a corporate environment where a message without a subject is downright unprofessional.

Background.  Unfortunately, Outlook does not enforce the use of the subject line or even offer an option for reminding you when you’ve forgotten to enter one.  From Outlook's perspective the subject is optional.

Solution.  Happily there’s a simple solution to this issue.  Through the use of a few lines of VBA (Visual Basic for Applications) code we can have Outlook check the subject line of every item we send.  If the subject line is blank, then the code can cancel the send and display a message asking us to give the item a subject.  Once the subject is filled in Outlook allows the item to go on its way.

Requirements.  This solution will work with any version of Outlook from 2000 through 2007.  Outlook 2010 adds a built-in check for a blank subject line (Note: Thanks to bromy2004 for pointing that out to me).  The solution does not work with Outlook Web Access (OWA).  OWA is Outlook in name only.  Unlike the full version of Outlook, OWA is a server-side process that runs at the Exchange server.  OWA does not support the use of VBA.

Instructions.  Follow these instructions to use this solution.

1. Add the Code to Outlook



Outlook 2000 - 2003.
1.      Start Outlook.
2.      Click ToolsMacroVisual Basic Editor.
3.      If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession.
4.      Copy the code below and paste it into the right-hand pane of Outlook's VB Editor window.
5.      Edit the code as needed.  I included comment lines wherever something needs to or can change.
6.      Click the diskette icon on the toolbar to save the changes.
7.      Close the VB Editor.
8.      Click ToolsMacroSecurity.
9.      Set the "Security Level" to Medium.
10.      Close Outlook
11.      Start Outlook
12.      Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Click Yes.

Outlook 2007.
1.      Start Outlook.
2.      Click ToolsMacroVisual Basic Editor.
3.      If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession.
4.      Copy the code below and paste it into the right-hand pane of Outlook's VB Editor window.
5.      Edit the code as needed.  I included comment lines wherever something needs to or can change.
6.      Click the diskette icon on the toolbar to save the changes.
7.      Close the VB Editor.
8.      Click ToolsTrust Center.
9.      Click Macro Security.
10.      Set "Macro Security" to Warnings for all macros.
11.      Click OK.
12.      Close Outlook
13.      Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Click Yes..

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If Item.Subject = "" Then
        'Edit the message and the popup caption on the next line as desired.'
        msgbox "You are not allowed to send an item with a blank subject.  Please enter a subject and send again.", vbCritical + vbOKOnly, "Prevent Blank Subjects"
        Cancel = True
    End If
End Sub

Open in new window

2. Test the Solution


Create a test message and leave the subject blank.  Click Send.  Outlook should cancel the send and display a pop-up message that looks something like this.
Sample Blank Subject Warning Dialog-oxLinks to Other BlueDevilFan Articles

1. Creating Linked Notes in Outlook 2007
2. Extending Outlook Rules via Scripting
3. Importing and Exporting Outlook 2007 Categories
4. Outlook 2007 Corporate Categories System
5. Automatically Printing/Saving Emails/Attachments in Outlook
6. Never Again Forget to Add that Attachment to your Outlook Email
7. Enhancing Outlook 2007 Meeting Reminders
18
Author:David Lee
Enjoy this complimentary article view.

Get unlimited access to our entire library of technical procedures, guides, and tutorials written by certified industry professionals.

Get 7 days free
Click here to view the full article

Using this article for work? Experts Exchange can benefit your whole team.

Learn More
COLLABORATE WITH CERTIFIED PROFESSIONALS
Experts Exchange is a tech solutions provider where users receive personalized tech help from vetted certified professionals. These industry professionals also write and publish relevant articles on our site.
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Learn from the best.