VBA: No Subject, No Body then No send
What the macro do
I need this macro when my boss ask me for a way to prevent the internal user
from sending mails to the firms partners with no subject or body text, This
macro is installed in all the firms computers including my own
☺.
Note
On this page I will not cover how you get it installed on all the computers
in you network or how you turn the Microsoft outlook security options on/off,
maybe some day I will make a page for it, if some one ask for it
The Setup
It is a Windows 2000 AD network with Exchange 2000 and the client side is
Windows XP with Office XP
The Macro
Okay here we go, first you start
Outlook and then you hit Alt-F11 to start the macro VBA editor

Under the Project you see the ThisOutlookSession, This is where we put the code into
This is the code to use, copy/paste the code into the VBA editor
|
Private Sub Application_ItemSend(ByVal Item As Object,
Cancel As Boolean) |
When you have done that, you will see some thing like this.

Now you just save the VBA project and close the editor, so you get back to outlook.
When you now make a new mail and forget to enter a subject line, you will not be allow to send and a nice dialog will popup

yah yah, now you enter a subject and try send again.....

click OK to close the dialog box, enter a body text and send the mail.......
So now your users only can send nice format mails and the mail receiver is a bit more happy
Download the code here (in a txt file)
Thomas ☺