Blank subject line

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

Guest

How can I make Microsoft Outlook prompt me before I send out an e-mail with a
blank Subject line? I have had one introductory programming class so am not
a programmer; I cannot even begin to figure out where to put the code or
bring up a code writing screen. I have seen the posts with the code, and I
can understand the language, but where do I put it?
 
Here's the VBA code, which needs to go in the built-in ThisOutlookSession module in Outlook VBA:

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

Outlook VBA basics:

1) Choose Tools | Macro | Security and set security to Medium.

2) Restart Outlook.

3) Press Alt + F11 to bring up the VBA environment,

4) Expand the Project Explorer at upper left.

5) Double-click the built-in ThisOutlookSession module to open it. Accept the prompt to enable macros.

6) Put all the code in ThisOutlookSession.

For a couple of basic Outlook automation tutorials, see:

http://support.microsoft.com/?kbid=220595
http://www.microsoft.com/office/previous/outlook/supreasy.asp

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Thank you so much. It worked out great.

Sue Mosher said:
Here's the VBA code, which needs to go in the built-in ThisOutlookSession module in Outlook VBA:

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

Outlook VBA basics:

1) Choose Tools | Macro | Security and set security to Medium.

2) Restart Outlook.

3) Press Alt + F11 to bring up the VBA environment,

4) Expand the Project Explorer at upper left.

5) Double-click the built-in ThisOutlookSession module to open it. Accept the prompt to enable macros.

6) Put all the code in ThisOutlookSession.

For a couple of basic Outlook automation tutorials, see:

http://support.microsoft.com/?kbid=220595
http://www.microsoft.com/office/previous/outlook/supreasy.asp

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
I agree that it works great, so thank-you.

And also well done to this help program for recognising that my question
about blank subject lines was answered in this thread, so thank-you again.

But why not have a simple switch somewhere in Mail settings that does this
for you? It seems slightly strange to me that Outlook Express always prompts
and Outlook doesn't prompt at all UNLESS you can write VB scripts. Perhaps
something for MS to consider adding in as an option for the next Outlook
release?
 
Outlook and Outlook Express are two different programs with vastly differing feature priorities.

That said, I don't know why Microsoft hasn't done it either.

--
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

Back
Top