Find words which start with a capital letter but are not the first

W

Wire

How can I find words which start with a capital letter but are not the first
word in a scentence (or a paragraph).

I have a document where Key Terms have been Capitalized and I need to change
all these to <b>Bold</b>.

I know how to change the formatting. I'm having problems finding ONLY the
Capitalized Words without the finding also all the first words in a scentence.

I also wish to exclude the word "I" of course.
 
G

Graham Mayor

See the answer to your similar post in another Word forum - please do not
multi-post

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Helmut Weber

Hi,

something along these line maybe helpful:

Sub Test0003()
Dim oSnt As Range
Dim rTmp As Range
For Each oSnt In ActiveDocument.Sentences
Set rTmp = oSnt.Duplicate
rTmp.Start = rTmp.Start + 1
With rTmp.Find
.Text = "<[A-Z][a-z]@>"
.MatchWildcards = True
While .Execute
rTmp.Select ' for testing
' now your endless code for all exceptions
' and the following depends on what you do to rTmp
rTmp.Start = rTmp.End
rTmp.End = oSnt.End
Stop ' for testing too
Wend
End With
Next
End Sub

Note: linguistic data (sentence, word, verb, noun...)
are usually fuzzy.
So a perfect solution will be very hard to find.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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