View Single Post
  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default How replace uppercase with lowercase

Hi Todd,

You didn't get a prompt because the macro wasn't written to provide
one. All the input is defined by the values placed in vFindText at the
beginning of the macro, and all the replacements are defined by the
values in vReplText. The remainder of the macro uses a loop to search
for each item in vFindText and replace it with the matching item in
vReplText. The result is that each upper case letter in the document
is replaced with the corresponding lower case letter.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Tue, 21 Mar 2006 08:01:28 -0800, T. Jenkins
wrote:

I found this posting useful, but could not get the macro to work properly.
It did something, but unfortunately did not prompt me for the text to
replace. Can you clarify how the macro functions?

Thanks,
Todd


"Graham Mayor" wrote:

You are right. I didn't read this as closely as I should. My brain is not
firing on all cylinders this morning so there may be a simpler method, but
the following macro will work in the meantime -
http://www.gmayor.com/installing_macro.htm

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long

vFindText = Array("([0-9] )A", "([0-9] )B", "([0-9] )C", "([0-9] )D", _
"([0-9] )E", "([0-9] )F", "([0-9] )G", "([0-9] )H", "([0-9] )I", _
"([0-9] )J", "([0-9] )K", "([0-9] )L", "([0-9] )M", "([0-9] )N", _
"([0-9] )O", "([0-9] )P", "([0-9] )Q", "([0-9] )R", "([0-9] )S", _
"([0-9] )T", "([0-9] )U", "([0-9] )V", "([0-9] )W", "([0-9] )X", _
"([0-9] )Y", "([0-9] )Z")
vReplText = Array("\1a", "\1b", "\1c", "\1d", _
"\1e", "\1f", "\1g", "\1h", "\1i", _
"\1j", "\1k", "\1l", "\1m", "\1n", _
"\1o", "\1p", "\1q", "\1r", "\1s", _
"\1t", "\1u", "\1v", "\1w", "\1x", _
"\1y", "\1z")
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True

For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute replace:=wdReplaceAll
Next i
End With
End Sub

--

Graham Mayor - Word MVP

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


A.N. wrote:
Thank you Graham, I read your article and several others on wildcard
use but am not having any luck regarding how to Replace an UpperCase
letter with a LowerCase letter (not whole words).

Thanks,
A.N.

"Graham Mayor" wrote in message
...
You'd need a wildcard search and replace for that - see
http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

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


A.N. wrote:
Thanks.

Do you know how I could search and find only those uppercase letters
that are ajacent to a number, and then to replace with a lowercase
letter instead?

Example: 1 This is a sentence

So the search is for ^number^space^uppercase letter

Replaced with lowercase letter.

Thanks,

AN


"George" wrote in message
...
1) Select all text
2) From Format menu select change case
3) Select sentence case

Regards,

George


? ??????? "A.N." ???????:

I need to change all uppercase first letters of words to
lowercase. Any ideas?

Thanks,

AN