autocapitalize after colons

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?
 
G

Greg Maxey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top