Auto sentence capitalization

T

tomrobroy

My question concerns the Word function that automatically capitalizes
the first letters of sentences. Since I do a lot of typing, i rarely
capitalize the first word of a sentence since I know Word is going to
do it for me. However, when I end a sentence with a number, it does
not capitalize the following sentence. There must be an "ignore"
function somewhere for instances such as this. Can anyone give me some
directions in how to do this?

I'd also like to thank the group for answering my other questions and
for the info I've picked up in here.
 
G

Greg Maxey

That is the way it is. You can run this macro to correct the
capitalization:

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
ActiveDocument.Range(0, 0).Select
With oRng.Find
.ClearFormatting
.Text = "([0-9]. {1,})[a-z]"
.MatchWildcards = True
While .Execute
oRng = Left(oRng, Len(oRng) - 1) & UCase(oRng.Characters.Last)
oRng.Collapse wdCollapseEnd
Wend
End With
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