autocapitalize after colons

  • Thread starter Thread starter treehugger
  • Start date Start date
T

treehugger

I need to have Word auto cap the first word after a
colon. How do I make this change? Also, I need to have
Word auto cap the first word in a sentence following a
sentence that ends in a number. For example: "The
patient's last visit was in 1999." Word does not
capitalize the first word of the subsequent sentence. How
can I change this?
 
Treehugger,

Can't be done with an options setting in Word. If you can wait until the
document is typed you can go back and us the following macro to correct any
inconsistencies. This macro will capitalize following a colon and numbers:

Sub CapWordAfterNumbersAndColon()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.SmallCaps = False
.AllCaps = True
End With
With Selection.Find
.Text = ": {1,}[a-z]"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find.Replacement.Font
.SmallCaps = False
.AllCaps = True
End With
With Selection.Find
.Text = "[0-9]{1,}. {1,}[a-z]"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 
Back
Top