Created
October 11, 2012 15:08
-
-
Save dansherman/3873073 to your computer and use it in GitHub Desktop.
Word VBA - Replace CAPS with Bold Title Case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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