Sharing our knowledge

Michael Sync

Outlook Tips : To prevent sending mails without mentioning ’subject’

December 1st, 2005 by Michael Sync

To prevent sending mails without mentioning ’subject’ use this code.

Steps – Open you outlook, press ALT+F11. On left pane in ‘Microsoft Outlook objects’, expand to see ‘This outlook session’. Double click to open the editor. Copy and paste the following code and save the session.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim strSubject As String
    strSubject = Item.Subject
    If Len(strSubject) = 0 Then
       Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
       If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
             Cancel = True
       End If
   End If
End Sub

9 Responses

  1. anonymous Says:

    after this script is saved you get a macro warning message every time you start outlook.

  2. Ashutosh Sharma Says:

    It remained there for that session, but when I restarted outlook, its no longer working…any clue?

  3. Venkatesh Varalu Says:

    Hi Ashutosh Sharma,

    1.In Outlook Go to Tools > Macros > Security > In the Security Level Tab > Select the option MEDIUM > OK
    2.Now Restart the Outlook, a dialog box pops up to Disable / Enable the macros; select as Enable Macros (this option will pops up when ever you restart outlook.
    3.From now on , this macro will make sure you do not make the mistake of sending a mail without subject

    Now the problem is that. All macros are disabled.

  4. idris Says:

    you should do this code for all users outlook, but i have more that 200 users,,,can i do this from exchange server to prevent sending outlook email without subject to all users???????

  5. Rudra Says:

    Hi,
    I paste the code as you suggested, but it is not working.
    please help.

  6. angel Says:

    hi Rudra,

    do as Venkatesh Varalu has said. It will work. ur macros are probably disabled.

  7. vije Says:

    hi

  8. Hesham Says:

    you should do this code for all users outlook, but i have more that 500 users,,,can i do this from exchange server to prevent sending outlook email without subject to all users???????

  9. msr Says:

    In Outlook 2007 it is not working. do you know any remedy for this?

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.