How to Setup a Prompt or Warning for Blank Subject on Ms Outlook 2007

 Microsoft Outlook 2007 does not validate for empty subject lines when sending out mails. This article provides a mechanism to achieve the same.

These days, in the expert world, Outlook is most famously utilized as the email customer. The title is a vital piece of any email. A decent headline can draw in the consideration of the email peruse. How often has it happened to you that you have sent an email through Outlook without a title? In the wake of tapping the Send button, you understand that you have committed an error. Is it true that you are neglecting to remember the headline for messages? Viewpoint doesn't approve for an unfilled headline.

We'll follow these steps to validate an empty subject line for Outlook 2007.

  1. Go to Tools -> Macro -> Visual Basic Editor. Or, directly press Alt + F11.


  1. The Visual Basic editor window gets opened.
  2. On the left pane, you will see Microsoft Outlook Objects or Project1, expand this. Now, you will see the ThisOutLookSession entry


  1. Double click on ThisOutLookSession. It will open up a code pane.
  2. Copy and paste the following code in the code pane:
        Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
   Dim strSubject As String
   strSubject = Item.Subject
   If Len(Trim(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


Now, just save the project.

For more information and credit please click here

0 comments: