Capitalisation in Find and Replace operations

A

arko02

Hi, I'm just writing because I have noticed an odd thing that Word does when
doing a "find and replace", and was wondering whether anyone know the reason
or a fix for it. Basically, I have found that if you ask Word to replace the
word "foo" (please excuse the word!) with the word "test", if the original
word is uppercase as in "FOO", Word will replace it with "TEST". Similarly,
if the original word is capitalised "Foo", Word will replace it with "Test",
even if you want it to replace it with "test". Does anyone know why Word
applies this capitalisation to words it replaces, and is there any way of
getting it to replace a word with the capitalisation you want, in this case
an all lower-case "test" (even if the original word has capitals)? I am using
Word 2008 on Mac OS X 10.6.2. Thanks!
 
J

John_McGhie_[MVP]

By design :) Word matches the existing capitalisation, unless you override
that.

If you click "Match Case" in your Find constraints, it will then replace
with the case you specify.

Click the unlabelled blue arrow to reveal the full properties of the Find
and replace function.

Cheers


Hi, I'm just writing because I have noticed an odd thing that Word does when
doing a "find and replace", and was wondering whether anyone know the reason
or a fix for it. Basically, I have found that if you ask Word to replace the
word "foo" (please excuse the word!) with the word "test", if the original
word is uppercase as in "FOO", Word will replace it with "TEST". Similarly,
if the original word is capitalised "Foo", Word will replace it with "Test",
even if you want it to replace it with "test". Does anyone know why Word
applies this capitalisation to words it replaces, and is there any way of
getting it to replace a word with the capitalisation you want, in this case
an all lower-case "test" (even if the original word has capitals)? I am using
Word 2008 on Mac OS X 10.6.2. Thanks!

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
C

CyberTaz

It isn't 'broken' :) By design, the default of the feature makes
replacements using the same case structure as what is already used in the
document. IOW, it swaps the strings without regard for - and without
tampering with - formatting.

If you want to impose case sensitivity or change any other settings click
the dialog expander button in the lower left corner of the F&R dialog -
You're specifically looking for the 'Match Case' checkbox. For details see
Word Help on the topic: Find and replace text

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
A

arko02

Hi John and Bob,

Thanks for your replies... The thing is, I've tried what you both suggested,
but the "match case" option only seems to affect the Find field, not the
Replace field, so for instance, if I've typed "FOO", and then in the Find and
Replace dialog box ask it to replace "foo" with "test" with the "match case"
checkbox ticked, it will say it can't find the word "foo" and therefore can't
replace anything. I just can't get the "match case" checkbox to affect the
Replace field. Do you guys have any ideas on any possible ways around this?
BTW, I just booted into Windows on my Mac, and tried the same thing in both
Word 2003 (for Windows) and a trial version of Word 2007, and the same thing
happened. Many thanks for your help!
 
P

Patty Winter

Hi, I'm just writing because I have noticed an odd thing that Word does when
doing a "find and replace", and was wondering whether anyone know the reason
or a fix for it. Basically, I have found that if you ask Word to replace the
word "foo" (please excuse the word!) with the word "test", if the original
word is uppercase as in "FOO", Word will replace it with "TEST". Similarly,
if the original word is capitalised "Foo", Word will replace it with "Test",
even if you want it to replace it with "test". Does anyone know why Word
applies this capitalisation to words it replaces

Word is just trying to be helpful by retaining the capitalization that
you already have, rather than arbitrarily changing it!

is there any way of
getting it to replace a word with the capitalisation you want, in this case
an all lower-case "test" (even if the original word has capitals)?

Sure, just check the "Match case" box in your Find and Replace window.
Then Word will put in the new word exactly as you have capitalized it.

(Note also that it will only *find* words that are capitalized exactly
as you've indicated, so if you need to change both "TEST" and "Test"
to "test," you'll have to do two passes. Unless someone else here knows
of a shortcut.)

BTW, if you aren't seeing the "Match case" checkbox and the other
options in the Find and Replace window, click on the arrow in the
little blue square.


Patty
 
P

Patty Winter

Thanks for your replies... The thing is, I've tried what you both suggested,
but the "match case" option only seems to affect the Find field, not the
Replace field, so for instance, if I've typed "FOO", and then in the Find and
Replace dialog box ask it to replace "foo" with "test" with the "match case"
checkbox ticked, it will say it can't find the word "foo" and therefore can't
replace anything.

That's because you're asking it to find "foo," but only "FOO" exists
in the document. So of course it says that it can't find "foo." If
you ask it to find "FOO" and replace that with "test," it will work.


Patty
 
J

John_McGhie_[MVP]

Don't feel bad: it took me a while to work this out also... :)

If text in the case you are searching for does not exist in the document,
then no replacement will be made. Which again, is correct.

If you Find FOO and replace with Foo, you will indeed get Foo. If you find
foo and replace with Foo, again you will get Foo.

It works: you just have to think about it. In my case, for quite a long
time :)

Cheers


Hi John and Bob,

Thanks for your replies... The thing is, I've tried what you both suggested,
but the "match case" option only seems to affect the Find field, not the
Replace field, so for instance, if I've typed "FOO", and then in the Find and
Replace dialog box ask it to replace "foo" with "test" with the "match case"
checkbox ticked, it will say it can't find the word "foo" and therefore can't
replace anything. I just can't get the "match case" checkbox to affect the
Replace field. Do you guys have any ideas on any possible ways around this?
BTW, I just booted into Windows on my Mac, and tried the same thing in both
Word 2003 (for Windows) and a trial version of Word 2007, and the same thing
happened. Many thanks for your help!

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
A

arko02

Thanks very much John and Patty for your replies, thanks to your answers I
have finally worked it out! I think what I wasn't understanding before was
that, if you check the "match case" checkbox, not only will it only replace
with the capitalisation you've indicated, it will also only find with the
capitalisation you've indicated... once I understood this, it works
perfectly! Many thanks again John, Patty and Bob for your help,

arko02
 
P

Patty Winter

Thanks very much John and Patty for your replies, thanks to your answers I
have finally worked it out! I think what I wasn't understanding before was
that, if you check the "match case" checkbox, not only will it only replace
with the capitalisation you've indicated, it will also only find with the
capitalisation you've indicated... once I understood this, it works
perfectly!

Great! Yes, you understand the concept perfectly now. It's very useful
to have that level of control--once you get the hang of it!


Patty
 

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