હિમાંશુ પરભુભાઇ મિસ્ત્રી | Himanshu Mistry

October 6, 2007

Useful TIP to overcome ‘No subject’ mails in Outlook.

Filed under: Uncategorized — Himanshubhai Mistry @ 2:34 pm

Hi All,

Hope this will be useful.

Forgot to mention subject, while writing an official mail and feel bad later?

Yes. It’s a concern for all. A mail without a subject brings a bad impression on us.

To avoid this, Just follow the simple steps mentioned below and see the result.

Here below are the steps: –
1. Open your outlook.
2. Press Alt+F11. This opens the Visual Basic editor and then Press Ctrl+R which in turn open Project-Project 1 (left side).

3. On the Left Pane, one can see “Microsoft Outlook Objects” or “Project1“, expand this. Now one can see the “ThisOutLookSession“.
4. Double click on “ThisOutLookSession“. It will open up a code pane.
5. Copy and Paste the following code in the right pane. (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. Do you still want to send the Mail?”
    If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, “Check for Subject”) = vbNo Then
      Cancel = True
      MsgBox “Give meaningful text in subjectline”, vbApplicationModal, “Edit Subjectline”
    End If
  End If
End Sub

6. Save and close vbeditor window.
7. down the security level from high to medium from tools menu >> macro >> security.
8. Exit (select exit from file menu) Microsoft outlook and open it again.
9. click on “Enable” when it ask for “ThisOutlookSession” contain macros. (this you have to select everytime you start outlook.
10.Now whenever u try to send a mail without subject, which will raise a pop-up to remind you.

notes: when you copy paste above code in vb editor window; the following statements should be in a single line.

[1] the 1st line  –>> starting with Private Sub……….. Cancel as Boolean)

[2.1] the 6th line If MsgBox………….=vbNo Then

[2.2] the 6th line should contain normal quotes and note smart quotes.  if you see the line in red colour then it contains smart quotes. please retype the quotes with keyboard

6 Comments »

  1. Use Thunderbird dude. Real email client😛

    Comment by કાર્તિક મિસ્ત્રી — October 9, 2007 @ 4:22 pm | Reply

  2. after restarting outlook this code not working.

    Comment by ragga — October 20, 2007 @ 8:20 am | Reply

  3. 🙂 not usefull

    Comment by magermani — November 4, 2007 @ 9:48 pm | Reply

  4. Hello Ragga and Margermani,

    I have retyped the article adding more steps to set it properly.

    Please try the steps again.

    Thanks,
    Himanshu

    Comment by Himanshubhai Mistry — November 5, 2007 @ 1:02 pm | Reply

  5. From: Padmakumar Gopalakrishnan Nair
    Sent: Monday, November 05, 2007 5:38 PM
    To: Himanshu Mistry
    Subject: RE: Hi Pappan, Could you please check this code?

    I tested the code. It is working.

    Only that the smart quote need be taken care and should take care to turn security settings to low.

    Regards,
    Pappan

    Comment by Himanshubhai Mistry — November 5, 2007 @ 7:36 pm | Reply

  6. I wanted to publish this macro in all computers in a domain,but it didn’t work.Could I use my exchange server to avoid sending message without subjects?

    Comment by Ali — February 22, 2009 @ 11:11 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: