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. 🙂
1. Open your Outlook
2. Press Alt+F11. This opens the Visual Basic editor and then Press Ctrl+R which in turn opens a 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) 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. Now whenever u try to send a mail without subject, it’ll raise a pop-up to remind you. Cool no?? 8)
Found this with a Google search. I’m running Outlook 2007 and evidently it will not notify you if you try to send a message without a subject. I’ve followed the instructions above but it coughs up an error. The VB editor opens and the 1st line is highlighted. Any ideas? I know nothing about VB.
Thanks!
Hi Jackie,
I struggled a lot to replicate the same error in my Outlook and finally got what could be wrong in there.. 🙂
If I am not wrong, you have just copy-pasted the above code in that code window. In fact, I have asked to do that much only but there is a small correction.
When you copy-paste the code, those double quote(“) are not taken as the intended double quote but some junk characters. (may be some codec problem but not sure what is that) Just delete those quote and type-in fresh double quote characters, it should work fine.
Let me know the result.
Cheers!
This fixed it not working for me in 2007. Re-type all quotes, then exit outlook and restart it. You should get a warning about macros, hit enable.
Thank you!
hi i have done as said above still i can send emails without subject.
Hey Archu , How u doing bab …
follow this link & u’ll get all ur solutions :
http://www.echarcha.com/forum/showthread.php?t=23056
Cheers.. & Enjoy
The syntax will still not work unless you change “Check for Subject” to “Check AND Subject”.
Change that and your script should work fine.
No, this is not the problem. If this doesn’t work, then there could be some problems with the macro security issue. Go to Tools -> Trust Center. On the left hand side of the Trust Center panel, click Macro Security. Now make sure you have either the Warnings for all macros or No security check for macros checked. If you choose the Warning…, then every time, you start the Outlook, you will get a warning and macros disable. Choose enable macro at the bottom. Have fun. 😉
Thanks man, it works fine 🙂
@ Archana
sorry for late reply. i think there is some basic problem, not with the script, because it worked for me, at least for the first time. but now it is not working for me also, don’t know why. ‘ll come back with the solution soon.
@Heavy
sorry dude, it didn’t work. plz let me know on which version of MS Outlook it works. Mine is MS Outlook 2003. Thanks in advance.
Hi,
The rule worked only once. When i restarted the PC, wasnt working anymore 😦
If this doesn’t work, then there could be some problems with the macro security issue. Go to Tools -> Trust Center. On the left hand side of the Trust Center panel, click Macro Security. Now make sure you have either the Warnings for all macros or No security check for macros checked. If you choose the Warning…, then every time, you start the Outlook, you will get a warning and macros disable. Choose enable macro at the bottom. Have fun. 😉
Thanks your information
Sometimes compiling the Script (it’s in the Script Editor’s Menu) helps
Works perfectly fine for me 🙂
It does not work on my system 😦
is there any basic problem in the code with Outlook 2003?
Hi Nitin,
I really don’t think there is problem with the code.
Anyway, let me dig out for more info on how to make it work with Outlook 2003 and get back to you.
Hii
I want the process where i should recived the any POP for only no subject mails in outlook 2003 now if i will assinged same process it is working but for all mail where i have insreted the subject also i am getting the pop so what should i do in this case
Hi Nabil,
Please make sure that you have the correct code in your outlook session. I mean check whether you have used the same variable (“Item” in this case) and see that you haven’t ended the outer IF loop abruptly, etc.. I really don’t see any issues with the code.
Hi
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?
Hi Ali,
I really don’t have any idea on using exchange server for this purpose.. sorry..
If this doesn’t work, then there could be some problems with the macro security issue. Go to Tools -> Trust Center. On the left hand side of the Trust Center panel, click Macro Security. Now make sure you have either the Warnings for all macros or No security check for macros checked. If you choose the Warning…, then every time, you start the Outlook, you will get a warning and macros disable. Choose enable macro at the bottom. Have fun. 😉
Hi thiendiatuyet,
I could find the script at n number of sites online.
BUT it worked only once for me & for so many of them out there.
But I made the changes suggested by you & it’s working for me damn every time!
You are a problem solver!
Three cheers to you,
-Ambarish 🙂
Thank you very much for this. It works !
Kind regards
Francis
Thank you for the provided code, also for the correction on manually refilling the double quotes. It worked for Outlook 2003 and solved the annoying problem on sending emails without subjects.
hi thiendiatuyet,
Excellent. It worked for me after applying your workaround.
Thanks
Guys it worked for me .Thanks
tat was kool
Works perfectly fine for me. This is what I need.
I had to change the security on the trust center to work after restarting Outlook.
Thanks for the code.
I found the same code at other site, but and had a problem in the first line when the variables are declared. This one is the same but it works fine!
Does anybody know something similar but for attachment file missing? i tried a couple of add-ins but one is just a trial and other one simply doesn’t work
Hi
this is realy helpful, but I am facing some issue with this.
I am using two outlook clients on my machine am able to save this script for one of the client but cannot save the other one giving error “The saved failed. this could be because there was not enougf hard disk space or, the project file is read-only”
can any one tell me what should I do to save this script.
currently am using Outlook 2003. and both the mail client are using exchange server
Didn’t wok for me until I retyped the double quotes.
THANKS!
Hi,
Sometimes we forget to put the SUBJECT in the mails which we send. That could be deadly sometimes when you are communicating to the clients; to avoid such a situation, follow the steps below. There after when you send a mail without subject, a pop up window asks for your confirmation. You can try it !
Steps:
1.Open your outlook
2.Press Alt+F11. This opens the Visual Basic editor
3.On the Left Pane, one can see ” Microsoft Outlook Objects”, expand this. Now one can see the “ThisOutLookSession”.
4.Click on “ThisOutLookSession”.
5.Copy and Paste the following code in the right pane. (Code Pane)
Code:
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
6.Save this and Now close the VB Code editor.
7.In Outlook Go to Tools > Macros > Security > In the Security Level Tab > Select the option MEDIUM > OK
8.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.
9.From now on , this macro will make sure you do not make the mistake of sending a mail without subject
That’s it!
thanks helped me a lot
My pleasure! 🙂
Did work until I restarted Outlook. pity you couldnt keep these changes
Thanks for this. I had the double quotes problem too, but it works like a charm now that I’ve replaced them.