Outlook allows us to write macros, which would stop us sending mails without a subject. All we have to do is to write a macro and save it. That takes care of preventing us for sending mails without a subject line.
To create a macro that pops up and asks if we really need to send a mail without a subject, follow the steps
- Open outlook
- Press Alt + F11 or click Tools –> Macro –> Visual Basic Editor to open the VB editor
- Press Ctrl + R or click view –> Project Explorer to open the project on the left side pane.
- Expand Project1 and you would find “Microsoft Office Outlook Objects”, Expanding this would show you “ThisOutlookSession”.
- Double click on “ThisOutlookSession” and paste the following lines.
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
Save the project and close it. Now try sending an email without subject line. A message box would pop up saying that there is no subject line and would you wish to continue sending the mail. Clicking “yes” would continue sending the mail and Clicking “No” would stop your mail. That’s it. Now you have an option to pen down your subject line even if you had forgotten it earlier. :-)