An Idea can change your life.....

Wednesday, March 18, 2009

Forgot Subject line? Add this script to outlook

Several times we forget to write in the subject line in mail, which might make us feel bad at times.
Simply follow these steps and it’ll prompt every time a mail is sent without a subject line,

1. Open Outlook.
2. Press Alt+F11 to open VBA editor and then Press Ctrl+R which in turn opens a Project-Project 1 (projects tree on left)
3. Expand this and you’ll see “ThisOutLookSession”.
4. Double click on “ThisOutLookSession” to open its code window.
5. Copy and Paste the following procedure and save it.

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

6. If the Prompt$ string literal doesn’t show properly, then just re-type the double quotes around it by removing existing ones. Do same for “Check for Subject” literal as well in MsgBox() function. Save code once done.
7. Now whenever you try to send a mail without subject, it’ll raise a pop-up to remind you.

No comments: