How to Auto Capitalize Each Word in Subject when Composing Your Outlook Email

When composing a new email and filling the subject, you may hope that Outlook is able to auto capitalize each word in subject line. Though Outlook doesn’t have a native feature, you still can get it by the means shared in this article.

Auto Capitalize Each Word in Subject when Composing Your Outlook Email

Perhaps you are accustomed to always capitalizing each word in mail subject line when composing an email. Yet, you may think that the frequent case shifts are too troublesome. Under this circumstance, it’s much more convenient if Outlook can auto accomplish the capitalization. In the followings, we will show a piece of VBA code, which can make it come true with effortless ease.

Auto Capitalize Each Word in Subject

  1. At the very beginning, start your Outlook program.
  2. In Outlook window, get access to VBA editor in accordance with the article – “How to Run VBA Code in Your Outlook”.
  3. Then, copy the following VBA code into the “ThisOutlookSession” project.
Public WithEvents objInspectors As Outlook.Inspectors
Public WithEvents objMail As Outlook.MailItem

Private Sub Application_Startup()
    Set objInspectors = Outlook.Application.Inspectors
End Sub

Private Sub objInspectors_NewInspector(ByVal Inspector As Inspector)
    If Inspector.currentItem.Class = olMail Then
       Set objMail = Inspector.currentItem
    End If
End Sub

Private Sub objMail_PropertyChange(ByVal Name As String)
    Dim strSubject As String
    Dim varWordArray As Variant
    Dim i As Long
    Dim strWord As String
    Dim strNewSubject As String

    If Name = "Subject" Then
       strSubject = objMail.Subject
       varWordArray = Split(strSubject, " ")
 
       For i = LBound(varWordArray) To UBound(varWordArray)
           strWord = varWordArray(i)
           strWord = UCase(Left(strWord, 1)) & LCase(Mid(strWord, 2))
           strNewSubject = strNewSubject & " " & strWord
       Next
 
       objMail.Subject = Trim(strNewSubject)
    End If
End Sub

VBA Code - Auto Capitalize Each Word in Subject

  1. Next, you can restart your Outlook application to activate this macro. Or click into “Application_Startup” subroutine and press “F5” key button.
  2. Finally, you can take a shot:
  • For a start, create a new email.
  • Then, fill in the subject line, such as “happy birthday, kelly”.
  • When you complete subject and move the cursor to the other field, you’ll see that the first letter of each word in subject is capitalized at once, such as becoming “Happy Birthday, Kelly”.Capitalized Subject

What to Do in Case of Outlook Corruption

Many users may have ever encountered Outlook crashes. Most of time, nothing will change after a restart. But, at times, unfortunately, your Outlook data file may get compromised. At that time, the best situation is that you’re keeping a recent and effective data backup, which will permit you to recover PST data with ease. If you have no such a backup, you have no alternative but to utilize a formidable fix tool, like DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf fix and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.