Display error if no subject is mentioned

G

Guest

Hi,
I am in th ehabit of sending mails without mentioning the subject....
Please let me know if there is any means so that I can get an error message
whenever I forget to write the subject.
Thanks,
Gaurav
 
S

Sue Mosher [MVP-Outlook]

There is no such feature, but you can build it in with a little VBA code:

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
If Item.Subject = "" Then
Cancel = True
strMsg = "Please fill in the subject before sending."
MsgBox strMsg, _
vbExclamation + vbSystemModal, "Missing Subject"
Item.Display
End If
End Sub

For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553

If you're new to Outlook VBA macros, these web pages should help you get started:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top