VBA & Macro Problems

Use a Word Macro to Lowercase and Italicize Uppercase Words

John WilsonJohn Wilson Nov 22, 2026 868 views

Question details

The user wants to lowercase and italicize uppercase words in a large Word document while retaining an initial capital at the beginning of a sentence.

Use a Word Macro to Lowercase and Italicize Uppercase Words
Product
Microsoft Word
Device & OS
not provided
Scenario
Automate formatting of words containing two or more uppercase letters in a large document.
Observed behavior
Uppercase words should become italic lowercase, except that the first letter should remain uppercase when the word starts a sentence.
Before you start

Open the document in a desktop version of Word that supports VBA macros. Review whether uppercase acronyms and headings should also change, because the macro processes all matching words in the document body.

Solution 1Recommended

Run a Word VBA macro to format uppercase words

Use this macro to find whole words made of at least two uppercase English letters, lowercase and italicize them, and capitalize their first letter at apparent sentence starts.

The macro uses Word's wildcard pattern <[A-Z]{2,}>. It checks the preceding characters for sentence-ending punctuation, a paragraph boundary, or the start of the document; this is a heuristic rather than a complete grammar check.

The search covers the main document body, not separate headers, footers, or text boxes. It also changes matching acronyms and headings.

1
Open the VBA editor

In Word, open the VBA editor from Developer > Visual Basic. If the Developer tab is hidden, enable it in Word's ribbon settings.

2
Insert the macro

In the VBA editor, choose Insert > Module and paste the following code: Sub LowercaseAndItalicizeUppercaseWords() Dim doc As Document Dim r As Range Dim replacement As String Dim startsSentence As Boolean Set doc = ActiveDocument Set r = doc.Content With r.Find .ClearFormatting .Text = "<[A-Z]{2,}>" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = True End With Do While r.Find.Execute startsSentence = IsSentenceStart(doc, r.Start) replacement = LCase$(r.Text) If startsSentence Then replacement = UCase$(Left$(replacement, 1)) & Mid$(replacement, 2) End If r.Text = replacement r.Italic = True r.SetRange Start:=r.End, End:=doc.Content.End Loop End Sub Private Function IsSentenceStart(doc As Document, wordStart As Long) As Boolean Dim p As Long Dim ch As String p = wordStart Do While p > doc.Content.Start ch = doc.Range(p - 1, p).Text Select Case ch Case " ", vbTab, Chr(11), """", "'", "(", "[", ChrW(8220), ChrW(8221), ChrW(8216), ChrW(8217) p = p - 1 Case ".", "!", "?", Chr(13), Chr(7) IsSentenceStart = True Exit Function Case Else Exit Function End Select Loop IsSentenceStart = True End Function

3
Run and review

Return to Word, open Developer > Macros, select LowercaseAndItalicizeUppercaseWords, and choose Run. Review the changed words, especially after abbreviations, in headings, and around unusual punctuation.

Run a Word VBA macro to format uppercase words
Check sentence boundaries: A period after an abbreviation can be mistaken for a sentence ending. The wildcard targets whole words consisting of uppercase A–Z letters; it does not cover every accented or mixed-case word.
Free Microsoft Office alternative

Edit and Format Word Documents with WPS Writer

WPS Writer is a free, lightweight alternative for editing and formatting documents. Its familiar interface and Word format compatibility make it easy to move existing files into WPS Office. The Word-specific VBA macro above is not a guaranteed WPS solution.

Apply lowercase and italic formatting while editing documentsOpen and save Microsoft Word DOC and DOCX filesUse a familiar word-processing interfaceMove existing documents into a lightweight office suite
QA img-9

Frequently Asked Questions

Will the macro change acronyms such as NASA?

Yes. NASA matches the uppercase-word pattern and will be changed. Review acronyms and other words that should remain uppercase after running the macro.

Why might a word after an abbreviation retain an initial capital?

The macro treats a preceding period as a sentence boundary, so an abbreviation such as “Dr.” can trigger capitalization. Review these cases in the document after running it.

Does the macro process headers and footers?

No. It searches the main document body through ActiveDocument.Content. Headers, footers, and text boxes require separate handling.

How can I open the macro list in Word?

In a desktop version of Word that supports VBA, choose Developer > Macros, select the macro, and choose Run. Enable the Developer tab in the ribbon settings if it is not visible.