Reply
 
Thread Tools Display Modes
  #1   Report Post  
BruceM
 
Posts: n/a
Default Can't get Replace to work

Our company documentation refers to Form 1234. It should have been Form
1234-5, but that has not been consistent. I would like to use Find and
Replace to fix it, but I cannot get Replace to work. This is what I have
tried (with several variations)using wildcards:
Find (1234)([!\-])
Replace with \1^~5\2

I have also tried Find (1234)([!\-]), and have left out the parentheses
around 1234 (Replace with 1234^~5\1 in that case), and every other variant I
can think of, but no luck. The idea is that I am looking for "1234" followed
by something other than a hyphen, and replacing it with "1234-5" (with a
nonbreaking hyphen) followed by whatever followed originally. I specify
something other than a hyphen because in a few cases it is written correctly
as "1234-5". I used \- because it seemed to be necessary if it was to find
the literal hyphen character. If the text is "(Form 1234)" it is supposed to
replace it with "(Form 1234-5)". Note that the parentheses are part of what
I have found in my document, but the quotes are for purposes of this question
only. What it does instead is find "(Form 1234)", but then replace it with
"(Form 1234)-5". It does the same with a space after "1234", and I end up
with "1234 -5". Can this be made to work, or is the hyphen or some other
special character going to mess this up?
  #2   Report Post  
Beth Melton
 
Posts: n/a
Default

If the document already has Form 1234-5 in some areas then find it
first and replace with Form 1234. Then you will have a consistent
search string and you can then Find: Form 1234 and Replace with: Form
1234-5.

No parenthesis or extra characters should be necessary.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
news
Our company documentation refers to Form 1234. It should have been
Form
1234-5, but that has not been consistent. I would like to use Find
and
Replace to fix it, but I cannot get Replace to work. This is what I
have
tried (with several variations)using wildcards:
Find (1234)([!\-])
Replace with \1^~5\2

I have also tried Find (1234)([!\-]), and have left out the
parentheses
around 1234 (Replace with 1234^~5\1 in that case), and every other
variant I
can think of, but no luck. The idea is that I am looking for "1234"
followed
by something other than a hyphen, and replacing it with "1234-5"
(with a
nonbreaking hyphen) followed by whatever followed originally. I
specify
something other than a hyphen because in a few cases it is written
correctly
as "1234-5". I used \- because it seemed to be necessary if it was
to find
the literal hyphen character. If the text is "(Form 1234)" it is
supposed to
replace it with "(Form 1234-5)". Note that the parentheses are part
of what
I have found in my document, but the quotes are for purposes of this
question
only. What it does instead is find "(Form 1234)", but then replace
it with
"(Form 1234)-5". It does the same with a space after "1234", and I
end up
with "1234 -5". Can this be made to work, or is the hyphen or some
other
special character going to mess this up?



  #3   Report Post  
BruceM
 
Posts: n/a
Default

Thanks for the prompt reply. I should have mentioned that I am hoping to
track changes, and do not want to have 1234-5 show up as a change if it is
already correct. I could go back and reject changes in that case, but it is
simpler at this point to just search for 1234, replace with 1234-5, and skip
over any that are already correct.

"Beth Melton" wrote:

If the document already has Form 1234-5 in some areas then find it
first and replace with Form 1234. Then you will have a consistent
search string and you can then Find: Form 1234 and Replace with: Form
1234-5.

No parenthesis or extra characters should be necessary.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
news
Our company documentation refers to Form 1234. It should have been
Form
1234-5, but that has not been consistent. I would like to use Find
and
Replace to fix it, but I cannot get Replace to work. This is what I
have
tried (with several variations)using wildcards:
Find (1234)([!\-])
Replace with \1^~5\2

I have also tried Find (1234)([!\-]), and have left out the
parentheses
around 1234 (Replace with 1234^~5\1 in that case), and every other
variant I
can think of, but no luck. The idea is that I am looking for "1234"
followed
by something other than a hyphen, and replacing it with "1234-5"
(with a
nonbreaking hyphen) followed by whatever followed originally. I
specify
something other than a hyphen because in a few cases it is written
correctly
as "1234-5". I used \- because it seemed to be necessary if it was
to find
the literal hyphen character. If the text is "(Form 1234)" it is
supposed to
replace it with "(Form 1234-5)". Note that the parentheses are part
of what
I have found in my document, but the quotes are for purposes of this
question
only. What it does instead is find "(Form 1234)", but then replace
it with
"(Form 1234)-5". It does the same with a space after "1234", and I
end up
with "1234 -5". Can this be made to work, or is the hyphen or some
other
special character going to mess this up?




  #4   Report Post  
Beth Melton
 
Posts: n/a
Default

Then try searching for Form 1234 and a space. Something like: "Form
1234 " (without the quotes).

btw, you can also turn off Track Changes, made the modifications, and
then turn Track Changes back on.

Or, of course, simply confirm every correction and not use Replace
All.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
...
Thanks for the prompt reply. I should have mentioned that I am
hoping to
track changes, and do not want to have 1234-5 show up as a change if
it is
already correct. I could go back and reject changes in that case,
but it is
simpler at this point to just search for 1234, replace with 1234-5,
and skip
over any that are already correct.

"Beth Melton" wrote:

If the document already has Form 1234-5 in some areas then find it
first and replace with Form 1234. Then you will have a consistent
search string and you can then Find: Form 1234 and Replace with:
Form
1234-5.

No parenthesis or extra characters should be necessary.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
news
Our company documentation refers to Form 1234. It should have
been
Form
1234-5, but that has not been consistent. I would like to use
Find
and
Replace to fix it, but I cannot get Replace to work. This is
what I
have
tried (with several variations)using wildcards:
Find (1234)([!\-])
Replace with \1^~5\2

I have also tried Find (1234)([!\-]), and have left out the
parentheses
around 1234 (Replace with 1234^~5\1 in that case), and every
other
variant I
can think of, but no luck. The idea is that I am looking for
"1234"
followed
by something other than a hyphen, and replacing it with "1234-5"
(with a
nonbreaking hyphen) followed by whatever followed originally. I
specify
something other than a hyphen because in a few cases it is
written
correctly
as "1234-5". I used \- because it seemed to be necessary if it
was
to find
the literal hyphen character. If the text is "(Form 1234)" it is
supposed to
replace it with "(Form 1234-5)". Note that the parentheses are
part
of what
I have found in my document, but the quotes are for purposes of
this
question
only. What it does instead is find "(Form 1234)", but then
replace
it with
"(Form 1234)-5". It does the same with a space after "1234", and
I
end up
with "1234 -5". Can this be made to work, or is the hyphen or
some
other
special character going to mess this up?






  #5   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

The space wouldn't help if there were punctuation after "Form 1234."

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Beth Melton" wrote in message
...
Then try searching for Form 1234 and a space. Something like: "Form
1234 " (without the quotes).

btw, you can also turn off Track Changes, made the modifications, and
then turn Track Changes back on.

Or, of course, simply confirm every correction and not use Replace
All.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
...
Thanks for the prompt reply. I should have mentioned that I am
hoping to
track changes, and do not want to have 1234-5 show up as a change if
it is
already correct. I could go back and reject changes in that case,
but it is
simpler at this point to just search for 1234, replace with 1234-5,
and skip
over any that are already correct.

"Beth Melton" wrote:

If the document already has Form 1234-5 in some areas then find it
first and replace with Form 1234. Then you will have a consistent
search string and you can then Find: Form 1234 and Replace with:
Form
1234-5.

No parenthesis or extra characters should be necessary.

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"BruceM" wrote in message
news Our company documentation refers to Form 1234. It should have
been
Form
1234-5, but that has not been consistent. I would like to use
Find
and
Replace to fix it, but I cannot get Replace to work. This is
what I
have
tried (with several variations)using wildcards:
Find (1234)([!\-])
Replace with \1^~5\2

I have also tried Find (1234)([!\-]), and have left out the
parentheses
around 1234 (Replace with 1234^~5\1 in that case), and every
other
variant I
can think of, but no luck. The idea is that I am looking for
"1234"
followed
by something other than a hyphen, and replacing it with "1234-5"
(with a
nonbreaking hyphen) followed by whatever followed originally. I
specify
something other than a hyphen because in a few cases it is
written
correctly
as "1234-5". I used \- because it seemed to be necessary if it
was
to find
the literal hyphen character. If the text is "(Form 1234)" it is
supposed to
replace it with "(Form 1234-5)". Note that the parentheses are
part
of what
I have found in my document, but the quotes are for purposes of
this
question
only. What it does instead is find "(Form 1234)", but then
replace
it with
"(Form 1234)-5". It does the same with a space after "1234", and
I
end up
with "1234 -5". Can this be made to work, or is the hyphen or
some
other
special character going to mess this up?








  #6   Report Post  
Klaus Linke
 
Posts: n/a
Default

Hi Bruce,

It's a mystery why your replacements failed... They work fine for me
(Word2003... but I'm pretty sure they'd work in any PC version).

Do you use an older Mac version?

One thing that is special about your doc is that you've got "Track changes"
turned on...
I don't have much experience with that, but think I ran into problems with
Find/Replace in protected documents a few times, if the text I wanted to replace
already had tracked changes.

If you could mail me a small sample file, perhaps I could try to reproduce the
error and see why it's occurring.

Regards,
Klaus


"Beth Melton" wrote:
True...

--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/


"Suzanne S. Barnhill" wrote in message
...
The space wouldn't help if there were punctuation after "Form 1234."





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
How do I delete files from the "Work" Built-In Menu button? Jedi Word Apprentice Microsoft Word Help 2 February 9th 05 10:13 PM
Hyperlinks don't work on my computer but do work on other computer TheDudeAbides Tables 1 February 8th 05 05:17 PM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM
How To Make Numbering Work Right? Peyton Todd Page Layout 2 December 17th 04 06:53 PM
replacing data in a word file? It doesn't replace my selection. sftv1 Microsoft Word Help 1 December 14th 04 08:03 PM


All times are GMT +1. The time now is 10:40 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"