Subject Line Warning?

R

Ross Payne

I use Outlook 2003. A couple of times, I've inadvertently sent an email
without a subject line. If I recall correctly, older versions of both
Outlook and Outlook Express warned you if you were about to do that. Does
anyone know how to configure Outlook 2003 to provide such a warning? Thanks,

Ross Payne
 
S

Sue Mosher [MVP-Outlook]

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

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
If Item.Subject = "" Then
Cancel = True
MsgBox "Please fill in the subject before sending.", _
vbExclamation, "Missing Subject"
End If
End Sub
 
R

Ross Payne

Yes! It worked . . . thanks again.

The only thing I'd like to change, and I doubt this can be done, is for the
pop-up to be in front of instead of behind the email window (to avoid having
to hit ALT + tab to get to it.

Ross
 
S

Sue Mosher [MVP-Outlook]

See if it works better if you have the VBA window closed.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

Ross Payne

Thanks, Sue. Now, however, it is not working at all. I closed Outlook, came
back later and restarted it. The macro is still there when I go to Tools,
Macro, Macros. What do you think happened?

Ross
 
S

Sue Mosher [MVP-Outlook]

FWIW, sometimes the VBA engine just doesn't seem want to start until you run
a macro manually. So try this: Close Outlook. Wait. Use Ctrl+Alt+Del to
check to see whether Outlook.exe is still active in the Task Manager. If so,
terminate it. Restart Outlook. Try running any macro with Alt+F8.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

Rich Cervenka

Yes, in the build-in ThisOutlookSession module. 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,

I've copied the coding that you posted in your previous message and
created a module under the ThisOutlookSession module from that code
and saved it. What do I have to do to enable it, so that it starts
working? I've looked at the two articles that you listed above and
can't figure out how to activate the new module. Do I now have to
create a macro from that module that I've created?

I'm confused! :(
--
Rich Cervenka
Chicago, Illinois, USA
Email Client: Microsoft Outlook 2002
News Client (Text): Forté Agent 2.0 www.forteinc.com
News Client (Binaries): News Rover 9.1.3 www.newsrover.com
 
S

Sue Mosher [MVP-Outlook]

You don't have to do anything to "activate" VBA code. However, the
Application_ItemSend event code needs to be in the ThisOutlookSession module
not in "a module under the ThisOutlookSession module." Also, check the
security setting under Tools | Macro | Security.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
R

Rich Cervenka

You don't have to do anything to "activate" VBA code. However, the
Application_ItemSend event code needs to be in the ThisOutlookSession module
not in "a module under the ThisOutlookSession module." Also, check the
security setting under Tools | Macro | Security.

Got it (finally)!

I was trying to create a separate module outside of ThisOutlookSession
and didn't know how to incorporate your code into the
ThisOutlookSession object. Once I figured that out, it worked fine.

Thanks, Sue!
--
Rich Cervenka
Chicago, Illinois, USA
Email Client: Microsoft Outlook 2002
News Client (Text): Forté Agent 2.0 www.forteinc.com
News Client (Binaries): News Rover 9.1.3 www.newsrover.com
 

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