How can I make outlook warn me before sending message without subj

R

Ravi Garg

I am using outlook 2003. Is there any way by which Outlook will not send
messge if I forgot to write subject in the mail.
 
R

Ravi Garg

Hi,
Thanks for your quick reply.
Here is a problem I am facing with this solution.

On Visual Basic editor screen, I double clicked on "Project1
(VbaProject.OTM)>Microsoft Office Outlook Objects>ThisOutlookSession" and
pasted follwoing code on right hand side panel(Code Pane).
---
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim strSubject As String
strSubject = Item.Subject
If Len(strSubject) = 0 Then
Prompt$ = " The Subject Line is Empty. Do you want to send anyway?"
If MsgBox(Prompt$, vbYesNo + vbDefaultButton2 + vbQuestion +
vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub
---

This solution worked for some time.. but afterwards, I don't know what
settings I changed in this time, it is not working at all.

I dont get any popup message and mail gets delivered without a subject.

Can anybody please help me in finding what is the problem in this solution?
 
S

Sue Mosher [MVP-Outlook]

Does other VBA code run? If not, check your setting in Tools | Macro | Security.

Also check Help | About Micrsooft Outlook | Disabled Items.

See http://www.outlookcode.com/d/vbabasics.htm for other basics.

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

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

Ravi Garg

Thanks Sue. Problem is solved.

Sue Mosher said:
Does other VBA code run? If not, check your setting in Tools | Macro | Security.

Also check Help | About Micrsooft Outlook | Disabled Items.

See http://www.outlookcode.com/d/vbabasics.htm for other basics.

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