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.
 
J

Jezebel

You're going to have to proof-read the damn document anyway if it's already
been screwed around with so badly. Apart from words at the start of
sentences, there are likely to be acronyms (and words like"O'Reilly") that
also need special handling. Trying to automate this is likely to introduce
more problems. Maybe not many, but you still have to find them.
 
W

Wire

No, I wrote the document, there are no "O'Reilly" like words.

The words are Capitalized because they are Important or Keywords.

I just want to make them all bold as well.
 
J

Jezebel

The words are Capitalized because they are Important or Keywords.

If you've littered your document with superfluous capitals as in that
sentence, you've certainly got a problem.
 
G

Graham Mayor

A wildcard search for

[ ][A-Z][a-z]{1,}

replace with

<b>^&</b> format > font > bold will help find, add the tags and embolden
them, but for reasons addressed by Jezebel I would step through the document
rather than replace all.
See http://www.gmayor.com/replace_using_wildcards.htm

Note that this will embolden the space before the word also. If you want the
leading <b> to be after the space, you will need another replace routine to
move it.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
W

Wire

Thanks Graham,

Sorry for the multipost, I thought that a programmatic solution may have
been required.

I have tried this search string and it still finds the first word of every
scentence. I will give you a sample paragraph:

"You can click on the Add row button to add an extra Custom Field to search.
You will notice that a new drop down box appears before the Custom Field
drop down box. This will allow you to perform a Logical Operation between
the two fields."

Also, I use 2 spaces after a full stop if that makes any difference.

Thanks.

Graham Mayor said:
A wildcard search for

[ ][A-Z][a-z]{1,}

replace with

<b>^&</b> format > font > bold will help find, add the tags and embolden
them, but for reasons addressed by Jezebel I would step through the document
rather than replace all.
See http://www.gmayor.com/replace_using_wildcards.htm

Note that this will embolden the space before the word also. If you want the
leading <b> to be after the space, you will need another replace routine to
move it.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

No, I wrote the document, there are no "O'Reilly" like words.

The words are Capitalized because they are Important or Keywords.

I just want to make them all bold as well.
 
I

Idaho Word Man

If they are key terms, it should be a reasonably short list. Don't you
remember what your key terms are? Search for them one at a time and bold
them. I hate to use an automated search, since you may have a capitalized
word that isn't one of your key terms.

Remember that sometimes one of your key terms might also be the first word
in a sentence (only one "c"). If you only search for the capitalized words
that are NOT the first word in a sentence, you'll miss all the key words that
are.
 
G

Graham Mayor

That was why Jezebel said it was a problem and why I suggested you step
through the found entries. There is no way to do what you want in a single
pass.
You can do it (cautiously) in two passes eg

Find
([! ][ ])([A-Z][a-z]{1,})
replace with
\1<b>\2</b> - format font bold

then
Find
[a-z][ ] format font bold
replace with
^& format font not bold

The following macro, which should be approached with caustion as I don't
know what else is in your document will do that on your sample text.

Sub TagBold()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([! ][ ])([A-Z][a-z]{1,})"
.Replacement.Text = "\1<b>\2</b>"
.Replacement.Font.Bold = True
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[a-z] "
.Font.Bold = True
.Replacement.Text = "^&"
.Replacement.Font.Bold = False
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

As for multi-posting. It is not the posts in more than one forum that is the
problem, but the lack of a link between them, which results in duplication
of effort by the volunteers who post replied here. If you access via NNTP it
is a simple matter to link the posts - http://www.gmayor.com/MSNews.htm If
you wish to post to more than one newsgroup, then put all the groups in the
same 'send-to' line separated by commas.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Thanks Graham,

Sorry for the multipost, I thought that a programmatic solution may
have been required.

I have tried this search string and it still finds the first word of
every scentence. I will give you a sample paragraph:

"You can click on the Add row button to add an extra Custom Field to
search. You will notice that a new drop down box appears before the
Custom Field drop down box. This will allow you to perform a Logical
Operation between the two fields."

Also, I use 2 spaces after a full stop if that makes any difference.

Thanks.

Graham Mayor said:
A wildcard search for

[ ][A-Z][a-z]{1,}

replace with

<b>^&</b> format > font > bold will help find, add the tags and
embolden them, but for reasons addressed by Jezebel I would step
through the document rather than replace all.
See http://www.gmayor.com/replace_using_wildcards.htm

Note that this will embolden the space before the word also. If you
want the leading <b> to be after the space, you will need another
replace routine to move it.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

No, I wrote the document, there are no "O'Reilly" like words.

The words are Capitalized because they are Important or Keywords.

I just want to make them all bold as well.

:

You're going to have to proof-read the damn document anyway if it's
already been screwed around with so badly. Apart from words at the
start of sentences, there are likely to be acronyms (and words
like"O'Reilly") that also need special handling. Trying to automate
this is likely to introduce more problems. Maybe not many, but you
still have to find them.





How can I find words which start with a capital letter but are not
the first
word in a sentence (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.
 
J

Jezebel

If the OP had done it manually, the task would have been completed long
since.



Graham Mayor said:
That was why Jezebel said it was a problem and why I suggested you step
through the found entries. There is no way to do what you want in a single
pass.
You can do it (cautiously) in two passes eg

Find
([! ][ ])([A-Z][a-z]{1,})
replace with
\1<b>\2</b> - format font bold

then
Find
[a-z][ ] format font bold
replace with
^& format font not bold

The following macro, which should be approached with caustion as I don't
know what else is in your document will do that on your sample text.

Sub TagBold()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([! ][ ])([A-Z][a-z]{1,})"
.Replacement.Text = "\1<b>\2</b>"
.Replacement.Font.Bold = True
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[a-z] "
.Font.Bold = True
.Replacement.Text = "^&"
.Replacement.Font.Bold = False
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

As for multi-posting. It is not the posts in more than one forum that is
the problem, but the lack of a link between them, which results in
duplication of effort by the volunteers who post replied here. If you
access via NNTP it is a simple matter to link the posts -
http://www.gmayor.com/MSNews.htm If you wish to post to more than one
newsgroup, then put all the groups in the same 'send-to' line separated by
commas.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Thanks Graham,

Sorry for the multipost, I thought that a programmatic solution may
have been required.

I have tried this search string and it still finds the first word of
every scentence. I will give you a sample paragraph:

"You can click on the Add row button to add an extra Custom Field to
search. You will notice that a new drop down box appears before the
Custom Field drop down box. This will allow you to perform a Logical
Operation between the two fields."

Also, I use 2 spaces after a full stop if that makes any difference.

Thanks.

Graham Mayor said:
A wildcard search for

[ ][A-Z][a-z]{1,}

replace with

<b>^&</b> format > font > bold will help find, add the tags and
embolden them, but for reasons addressed by Jezebel I would step
through the document rather than replace all.
See http://www.gmayor.com/replace_using_wildcards.htm

Note that this will embolden the space before the word also. If you
want the leading <b> to be after the space, you will need another
replace routine to move it.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Wire wrote:
No, I wrote the document, there are no "O'Reilly" like words.

The words are Capitalized because they are Important or Keywords.

I just want to make them all bold as well.

:

You're going to have to proof-read the damn document anyway if it's
already been screwed around with so badly. Apart from words at the
start of sentences, there are likely to be acronyms (and words
like"O'Reilly") that also need special handling. Trying to automate
this is likely to introduce more problems. Maybe not many, but you
still have to find them.





How can I find words which start with a capital letter but are not
the first
word in a sentence (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

Almost certainly ;)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
If the OP had done it manually, the task would have been completed
long since.



Graham Mayor said:
That was why Jezebel said it was a problem and why I suggested you
step through the found entries. There is no way to do what you want
in a single pass.
You can do it (cautiously) in two passes eg

Find
([! ][ ])([A-Z][a-z]{1,})
replace with
\1<b>\2</b> - format font bold

then
Find
[a-z][ ] format font bold
replace with
^& format font not bold

The following macro, which should be approached with caustion as I
don't know what else is in your document will do that on your sample
text. Sub TagBold()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([! ][ ])([A-Z][a-z]{1,})"
.Replacement.Text = "\1<b>\2</b>"
.Replacement.Font.Bold = True
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[a-z] "
.Font.Bold = True
.Replacement.Text = "^&"
.Replacement.Font.Bold = False
End With
Selection.Find.Execute replace:=wdReplaceAll
End Sub

As for multi-posting. It is not the posts in more than one forum
that is the problem, but the lack of a link between them, which
results in duplication of effort by the volunteers who post replied
here. If you access via NNTP it is a simple matter to link the posts
- http://www.gmayor.com/MSNews.htm If you wish to post to more
than one newsgroup, then put all the groups in the same 'send-to'
line separated by commas.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Thanks Graham,

Sorry for the multipost, I thought that a programmatic solution may
have been required.

I have tried this search string and it still finds the first word of
every scentence. I will give you a sample paragraph:

"You can click on the Add row button to add an extra Custom Field to
search. You will notice that a new drop down box appears before the
Custom Field drop down box. This will allow you to perform a
Logical Operation between the two fields."

Also, I use 2 spaces after a full stop if that makes any difference.

Thanks.

:

A wildcard search for

[ ][A-Z][a-z]{1,}

replace with

<b>^&</b> format > font > bold will help find, add the tags and
embolden them, but for reasons addressed by Jezebel I would step
through the document rather than replace all.
See http://www.gmayor.com/replace_using_wildcards.htm

Note that this will embolden the space before the word also. If you
want the leading <b> to be after the space, you will need another
replace routine to move it.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Wire wrote:
No, I wrote the document, there are no "O'Reilly" like words.

The words are Capitalized because they are Important or Keywords.

I just want to make them all bold as well.

:

You're going to have to proof-read the damn document anyway if
it's already been screwed around with so badly. Apart from words
at the start of sentences, there are likely to be acronyms (and
words like"O'Reilly") that also need special handling. Trying to
automate this is likely to introduce more problems. Maybe not
many, but you still have to find them.





How can I find words which start with a capital letter but are
not the first
word in a sentence (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.
 

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