Skip to main content

How to prevent users sending emails without subject entered in Outlook?

While you send an email through Outlook, in some times, you can send emails without subject entering which maybe is not a good habit. Is there any way to force users to send email with a subject in Outlook?

Prevent sending emails without subject entered with VBA


Prevent sending emails without subject entered with VBA

There is no way except VBA code to solve this problem.

1. Enable Outlook, press Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Double click ThisOutlookSession in the Project1 pane, then copy and paste below code to the blank script.

VBA: Prevent sending email without subject

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'UpdatebyExtendoffice20180511
Dim xObject As Object
On Error Resume Next
If Item.Class <> olMail Then Exit Sub
Set xObject = CreateObject("VBScript.Regexp")
With xObject
    .Global = True: .Pattern = "^\x20*$"
    If .test(Item.Subject) = True Then
        MsgBox "No subject entered", vbInformation, "Kutools for Outlook"
        Cancel = True
    End If
End With
End Sub

doc prevent sending whithout subject 1

3. Save the code, now if the email you send without subject, it will pop out a dialog to remind entering subject.

Note: This VBA code work for all accounts in Outlook


Best Office Productivity Tools

Kutools for Outlook - Over 100 Powerful Features to Supercharge Your Outlook

πŸ€– AI Mail Assistant: Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

πŸ“§ Email Automation: Out of Office (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

πŸ“¨ Email Management: Easily Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

πŸ“ Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Boost Your Outlook Productivity with Tabbed Views  /  Minimize Outlook Instead of Closing ...

πŸ‘ One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  πŸ•˜Show Sender's Time Zone ...

πŸ‘©πŸΌβ€πŸ€β€πŸ‘©πŸ» Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Over 100 Features Await Your Exploration! Click Here to Discover More.

Read More       Free Download      Purchase
 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations