I'm sure this question has been asked many times but the more I search, the more confused I get. I have created macros some years ago when I had more brain cells working, but for the life of me I can't get this to work...................
I'm trying to insert a macro in Outlook 2003 to warn me if I inadvertently try to send an email with no subject line.
I found this code:
and have been trying to insert it in Outlook. I open the VBA editor and can see the code in "ThisOutlookSession" in a window headed VbaProject.OTM - ThisOutlookSession (Code) but, when I click on Tools/Macro/Macros, nothing is visible nor is there any warning when sending mails without subject.
I'm sure I'm doing something immeasurably stupid but would be greatful for being pointed in the right direction.
I'm running Office 2003 on W7 Home Premium x64 with all updates in place.
I'm trying to insert a macro in Outlook 2003 to warn me if I inadvertently try to send an email with no subject line.
I found this code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub
Dim strSubject As String
strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub
and have been trying to insert it in Outlook. I open the VBA editor and can see the code in "ThisOutlookSession" in a window headed VbaProject.OTM - ThisOutlookSession (Code) but, when I click on Tools/Macro/Macros, nothing is visible nor is there any warning when sending mails without subject.
I'm sure I'm doing something immeasurably stupid but would be greatful for being pointed in the right direction.
I'm running Office 2003 on W7 Home Premium x64 with all updates in place.