Skip to main content

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

Author: Sun Last Modified: 2020-11-20

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

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

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

πŸ“§ Email Automation: Auto Reply (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: 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   /  Remind you when important emails come  /  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 ...

Instantly unlock Kutools for Outlook with a single clickβ€”permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

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