Disable Outlook 2010's No Subject Warning using VBA

Last reviewed on September 17, 2013   —  10 comments

Use this macro to disable the blank subject warning in Outlook 2010.

If you are looking for a macro to warn you that the subject is blank in earlier versions of Outlook, see Macro to Warn Before Sending a Message with a Blank Subject.

Please note: If you need help with this macro, please use the comments section below.

To use, open the VBA Editor using Alt+F11 and paste this into ThisOutlookSession.

Reprinted with permission of Peter Marchert

Option Explicit
' Prevents Outlook 2010 no-subject warning message
' (c) Peter Marchert -http://www.outlook-stuff.com
' 2010-07-15 Version 1.0.0
' 2010-07-19 Version 1.0.1
' 2010-08-01 Version 1.1.0
' 2010-08-31 Version 1.1.1

Private WithEvents colInspectors As Outlook.Inspectors

Private Sub Application_Startup()

Set colInspectors = Outlook.Inspectors

End Sub

Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)

Dim objItem As Object

On Error GoTo ExitProc

Set objItem = Inspector.currentItem

If InStr(LCase(objItem.MessageClass), "ipm.appointment") > 0 Then
If objItem.MeetingStatus = 0 Then GoTo ExitProc

End If

If objItem.EntryID = "" Then
If objItem.Subject = "" Then objItem.Subject = " "
If objItem.Location = "" Then objItem.Location = " "

End If


Set objItem = Nothing
Set Inspector = Nothing

End Sub

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

On Error Resume Next

Item.Subject = Trim(Item.Subject)
Item.Location = Trim(Item.Location)

End Sub

Private Sub Application_Quit()

Set colInspectors = Nothing

End Sub

About Slipstick

Please post long or more complicated questions at Outlook forums by Slipstick.com.

10 responses to “Disable Outlook 2010's No Subject Warning using VBA”

  1. paolo

    hi. where will i enter that command? i mean where could i find thisoutlooksession? please help

    1. Diane Poremsky

      Press Alt+F11 to open the VB editor then expand the Project folder on the left. ThisOutlookSession is under it.

  2. shadi bartsch

    pressing alt and F11 doesn't do anything

    1. Diane Poremsky

      That will open the VBA Editor. You can also open it by enabling the Developer ribbon in File, Customize ribbon then clicking the Visual Basic button on the Developer ribbon.

  3. mac

    didn't work...now how to delete the code ???

    1. Diane Poremsky

      Open the VBA editor (Alt+F11) expand Project1, select the code, delete it and Save the project.

  4. Kaci

    I entered the code into ThisOutlookSession, and it still prompts me before I send a message. I copied the code starting at "option Explicit"... do I include that as well?

    1. Diane Poremsky

      This is an application start up macro - you need to restart outlook or click in the Application startup macro and press Run. This macro needs to be in ThisOutlookSession to work.

  5. Dale Thompson

    I had to disable this "IF" statement for the macro to work, as my e-mails have an EntryID:

    'If objItem.EntryID = "" Then
    If objItem.Subject = "" Then objItem.Subject = " "
    If objItem.Location = "" Then objItem.Location = " "
    'End If

  6. JohnnyCakes

    You must also do this for it to work (which is on the original page from which this is copied):

    Whilst in Outlook select File > Options > Trust Center > Trust Center Settings > Macro Settings > Seelct "Enable all macros..." > Tick "Apply macro security..." > OK.

Leave a Reply

If the Post Comment button disappears, press your Tab key.

This site uses XenWord.