Skip to content

Instantly share code, notes, and snippets.

@dansherman
Created October 11, 2012 15:08
Show Gist options
  • Select an option

  • Save dansherman/3873073 to your computer and use it in GitHub Desktop.

Select an option

Save dansherman/3873073 to your computer and use it in GitHub Desktop.
Word VBA - Replace CAPS with Bold Title Case
Sub ChangeCAPStoBold()
With Selection.Find
.Text = "(<[A-Z.]{2,})"
.Replacement.Text = "\1"
.Replacement.Font.Bold = True
.MatchWildcards = True
.Wrap = wdFindContinue
.Format = True
End With
While Selection.Find.Execute
Selection.Range.Case = wdTitleWord
Selection.Font.Bold = True
Wend
End Sub
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment