How do I setup a warning if I leave the subject line blank?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have seen a warning previously when sending an email without a subject
line. I would like to setup my outlook so that when I don't have a subject
in my subject line, I get a reminder that it is blank before the message is
sent.
 
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


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

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