Reply
 
Thread Tools Display Modes
  #1   Report Post  
ed9213
 
Posts: n/a
Default Find and Replace Adjacent Capitals

I read in other forum threads that Word 2002 will not correct a word in all
caps that contains only two characters because it would correct Postal
Service abbreviations.

I still have to search documents for instances where I did not release the
shift key in time and have sentences beginning with HE, IN, WE, etc., and
tried to define this condition in the Find and Replace window. I could not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is capitalized in
Arial or Times New Roman? Can that be expanded to search for any two
adjacent letters that have been capitalized, like my examples above, or State
abbreviations, and manually correct them if needed?
Thanks
--
ed
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

A macro containing the following code should do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

For an explanation of the use of wildcards, see the article "Finding and
replacing characters using wildcards" at:
http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ed9213" wrote in message
...
I read in other forum threads that Word 2002 will not correct a word in all
caps that contains only two characters because it would correct Postal
Service abbreviations.

I still have to search documents for instances where I did not release the
shift key in time and have sentences beginning with HE, IN, WE, etc., and
tried to define this condition in the Find and Replace window. I could
not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is capitalized
in
Arial or Times New Roman? Can that be expanded to search for any two
adjacent letters that have been capitalized, like my examples above, or
State
abbreviations, and manually correct them if needed?
Thanks
--
ed



  #3   Report Post  
ed9213
 
Posts: n/a
Default

Doug,

Thanks for the macro code. When I pasted it into the Visual Basic Editor
and tried to run it, I received a compile error: invalid outside procedure.

I'm not very familiar with the editor, so perhaps there is significance in
the Do While ... routine was converted to Red text in the editor, and the
word wdStory was highlighted.

Is this simple to resolve?

Thanks.
--
ed


"Doug Robbins" wrote:

A macro containing the following code should do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

For an explanation of the use of wildcards, see the article "Finding and
replacing characters using wildcards" at:
http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ed9213" wrote in message
...
I read in other forum threads that Word 2002 will not correct a word in all
caps that contains only two characters because it would correct Postal
Service abbreviations.

I still have to search documents for instances where I did not release the
shift key in time and have sentences beginning with HE, IN, WE, etc., and
tried to define this condition in the Find and Replace window. I could
not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is capitalized
in
Arial or Times New Roman? Can that be expanded to search for any two
adjacent letters that have been capitalized, like my examples above, or
State
abbreviations, and manually correct them if needed?
Thanks
--
ed




  #4   Report Post  
Graham Mayor
 
Posts: n/a
Default

See http://www.gmayor.com/installing_macro.htm

Doug's code was split permaturely in the e-mail editor. Try

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", _
MatchWildcards:=True, _
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

http://www.gmayor.com/replace_using_wildcards.htm explains how to search
for particular combinations of characters.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org






ed9213 wrote:
Doug,

Thanks for the macro code. When I pasted it into the Visual Basic
Editor and tried to run it, I received a compile error: invalid
outside procedure.

I'm not very familiar with the editor, so perhaps there is
significance in the Do While ... routine was converted to Red text in
the editor, and the word wdStory was highlighted.

Is this simple to resolve?

Thanks.

A macro containing the following code should do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

For an explanation of the use of wildcards, see the article "Finding
and replacing characters using wildcards" at:
http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ed9213" wrote in message
...
I read in other forum threads that Word 2002 will not correct a
word in all caps that contains only two characters because it would
correct Postal Service abbreviations.

I still have to search documents for instances where I did not
release the shift key in time and have sentences beginning with HE,
IN, WE, etc., and tried to define this condition in the Find and
Replace window. I could not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is
capitalized in
Arial or Times New Roman? Can that be expanded to search for any
two adjacent letters that have been capitalized, like my examples
above, or State
abbreviations, and manually correct them if needed?
Thanks
--
ed



  #5   Report Post  
ed9213
 
Posts: n/a
Default

Graham,

Thanks for the revision.

I still get an "invalid outside procedure" error when I run this macro,
also. The only indication of what might be causing it is the word "wdStory"
was highlighted when the error box came up.

Should that be altered somehow?

Thanks.
--
ed


"Graham Mayor" wrote:

See http://www.gmayor.com/installing_macro.htm

Doug's code was split permaturely in the e-mail editor. Try

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", _
MatchWildcards:=True, _
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

http://www.gmayor.com/replace_using_wildcards.htm explains how to search
for particular combinations of characters.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org






ed9213 wrote:
Doug,

Thanks for the macro code. When I pasted it into the Visual Basic
Editor and tried to run it, I received a compile error: invalid
outside procedure.

I'm not very familiar with the editor, so perhaps there is
significance in the Do While ... routine was converted to Red text in
the editor, and the word wdStory was highlighted.

Is this simple to resolve?

Thanks.

A macro containing the following code should do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

For an explanation of the use of wildcards, see the article "Finding
and replacing characters using wildcards" at:
http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"ed9213" wrote in message
...
I read in other forum threads that Word 2002 will not correct a
word in all caps that contains only two characters because it would
correct Postal Service abbreviations.

I still have to search documents for instances where I did not
release the shift key in time and have sentences beginning with HE,
IN, WE, etc., and tried to define this condition in the Find and
Replace window. I could not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is
capitalized in
Arial or Times New Roman? Can that be expanded to search for any
two adjacent letters that have been capitalized, like my examples
above, or State
abbreviations, and manually correct them if needed?
Thanks
--
ed






  #6   Report Post  
Graham Mayor
 
Posts: n/a
Default

Change the line to:
Selection.HomeKey Unit:=wdStory

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




ed9213 wrote:
Graham,

Thanks for the revision.

I still get an "invalid outside procedure" error when I run this
macro, also. The only indication of what might be causing it is the
word "wdStory" was highlighted when the error box came up.

Should that be altered somehow?

Thanks.

See http://www.gmayor.com/installing_macro.htm

Doug's code was split prematurely in the e-mail editor. Try

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", _
MatchWildcards:=True, _
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

http://www.gmayor.com/replace_using_wildcards.htm explains how to
search for particular combinations of characters.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org






ed9213 wrote:
Doug,

Thanks for the macro code. When I pasted it into the Visual Basic
Editor and tried to run it, I received a compile error: invalid
outside procedure.

I'm not very familiar with the editor, so perhaps there is
significance in the Do While ... routine was converted to Red text
in the editor, and the word wdStory was highlighted.

Is this simple to resolve?

Thanks.

A macro containing the following code should do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2} ", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Range.Case = wdTitleWord
Loop
End With

For an explanation of the use of wildcards, see the article
"Finding and replacing characters using wildcards" at:
http://word.mvps.org/FAQs/General/UsingWildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my services on a paid consulting basis.

Doug Robbins - Word MVP
"ed9213" wrote in message
...
I read in other forum threads that Word 2002 will not correct a
word in all caps that contains only two characters because it
would correct Postal Service abbreviations.

I still have to search documents for instances where I did not
release the shift key in time and have sentences beginning with
HE, IN, WE, etc., and tried to define this condition in the Find
and Replace window. I could not
come up with the right combination of parameters.

Is there a way to search for any letter or character that is
capitalized in
Arial or Times New Roman? Can that be expanded to search for any
two adjacent letters that have been capitalized, like my examples
above, or State
abbreviations, and manually correct them if needed?
Thanks
--
ed



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace GREEK symbols in XP, 2K & 97 Jazz Microsoft Word Help 3 April 8th 05 08:13 PM
Problem with function "Find and Replace" in Word. Pat Microsoft Word Help 3 March 16th 05 01:04 PM
Find and Replace Michael R New Users 11 January 22nd 05 05:31 PM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM
find and replace symbols Tewodaj New Users 8 January 11th 05 02:22 AM


All times are GMT +1. The time now is 04:37 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"