PC Review


Reply
Thread Tools Rate Thread

Word Bug: Find/Replace wildcards while track changes is turned on is buggy

 
 
indeego@gmail.com
Guest
Posts: n/a
 
      23rd Feb 2006
A user I work with has found an unusual bug in Microsoft Word, and I'm
wondering if there is a fix for it that ya'll know about. Here's the
scenario. It only is a problem when he has Tracking Changes turned on:
the find and replace works fine when Tracking Changes is off.

I've got some text in a document, that includes ..."claim 1"...
(although the number could be replaced with any other string of
characters, where the first character is a digit, in the example search
and replace I am performing, the number has to be exactly 1 digit
long). I want to put a flag character before and after the string
beginning with the number. I search for the following string in the
Find and Replace dialog box: "<([Cc][Ll][Aa][Ii][Mm]> )([0-9])", with
wildcards activated. This search performs perfectly. I then replace
it with the following string: "\1#\2#". What this should do is delete
the text "claim 1" from the document and insert "claim #1#" instead.
(Microsoft Word probably has some formula that dictates where the
inserted text is put relative to the deleted text, but I can't figure
out the pattern: it appears to be all over the map. What should
definitely hold true, though, is that if I were to accept both the
deletion and insertion, I would end up with pound signs before and
after the number string. And ideally, the deletion and insertion would
be done in blocks: all deleted characters together, and all inserted
characters together.) But what actually happens is that the characters
are inserted out of order, and in such a way as to make the replacement
worthless for future use. Here is what comes out (with bolded
characters representing the deleted characters, and underscores the
inserted characters):

claim c1laim 1##

I can replace the pound signs in the replace string with anything I
want, the result is the same (except that where the number is inserted
into the deleted word "claim" depends on the length of the string I was
putting before the number.

The problem definitely relates to the use of wildcards: specifically,
the use of the "Find what expression" in the Replace string (that is,
the \1, \2, etc). I know this because if I were to search for
"<([Cc][Ll][Aa][Ii][Mm]> )1" and replace it with \1#1#, the text "claim
" is inserted before the deleted text, whereas the "#1#" is inserted
after the deleted text. And if I were to do a find and replace without
any "Find what expressions", all of the original text is deleted first,
then all of the replacement text is inserted. But since I need to do
this from within a macro, I have to use the "Find what expression" to
do the search and replace.

Any ideas?

Thanks in advance.

 
Reply With Quote
 
 
 
 
Jezebel
Guest
Posts: n/a
 
      23rd Feb 2006
I tried this (Word 2003) and can't replicate the problem.


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>A user I work with has found an unusual bug in Microsoft Word, and I'm
> wondering if there is a fix for it that ya'll know about. Here's the
> scenario. It only is a problem when he has Tracking Changes turned on:
> the find and replace works fine when Tracking Changes is off.
>
> I've got some text in a document, that includes ..."claim 1"...
> (although the number could be replaced with any other string of
> characters, where the first character is a digit, in the example search
> and replace I am performing, the number has to be exactly 1 digit
> long). I want to put a flag character before and after the string
> beginning with the number. I search for the following string in the
> Find and Replace dialog box: "<([Cc][Ll][Aa][Ii][Mm]> )([0-9])", with
> wildcards activated. This search performs perfectly. I then replace
> it with the following string: "\1#\2#". What this should do is delete
> the text "claim 1" from the document and insert "claim #1#" instead.
> (Microsoft Word probably has some formula that dictates where the
> inserted text is put relative to the deleted text, but I can't figure
> out the pattern: it appears to be all over the map. What should
> definitely hold true, though, is that if I were to accept both the
> deletion and insertion, I would end up with pound signs before and
> after the number string. And ideally, the deletion and insertion would
> be done in blocks: all deleted characters together, and all inserted
> characters together.) But what actually happens is that the characters
> are inserted out of order, and in such a way as to make the replacement
> worthless for future use. Here is what comes out (with bolded
> characters representing the deleted characters, and underscores the
> inserted characters):
>
> claim c1laim 1##
>
> I can replace the pound signs in the replace string with anything I
> want, the result is the same (except that where the number is inserted
> into the deleted word "claim" depends on the length of the string I was
> putting before the number.
>
> The problem definitely relates to the use of wildcards: specifically,
> the use of the "Find what expression" in the Replace string (that is,
> the \1, \2, etc). I know this because if I were to search for
> "<([Cc][Ll][Aa][Ii][Mm]> )1" and replace it with \1#1#, the text "claim
> " is inserted before the deleted text, whereas the "#1#" is inserted
> after the deleted text. And if I were to do a find and replace without
> any "Find what expressions", all of the original text is deleted first,
> then all of the replacement text is inserted. But since I need to do
> this from within a macro, I have to use the "Find what expression" to
> do the search and replace.
>
> Any ideas?
>
> Thanks in advance.
>



 
Reply With Quote
 
Tony Jollans
Guest
Posts: n/a
 
      24th Feb 2006
Interesting but no help I'm afraid.

Yes, I see this in Word 2003 (with no service packs); it happens with very
simple searches - the \n replacement seems to be put before whatever should
be before it. I can't explain it and can't offer any way round it either.

--
Enjoy,
Tony


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> A user I work with has found an unusual bug in Microsoft Word, and I'm
> wondering if there is a fix for it that ya'll know about. Here's the
> scenario. It only is a problem when he has Tracking Changes turned on:
> the find and replace works fine when Tracking Changes is off.
>
> I've got some text in a document, that includes ..."claim 1"...
> (although the number could be replaced with any other string of
> characters, where the first character is a digit, in the example search
> and replace I am performing, the number has to be exactly 1 digit
> long). I want to put a flag character before and after the string
> beginning with the number. I search for the following string in the
> Find and Replace dialog box: "<([Cc][Ll][Aa][Ii][Mm]> )([0-9])", with
> wildcards activated. This search performs perfectly. I then replace
> it with the following string: "\1#\2#". What this should do is delete
> the text "claim 1" from the document and insert "claim #1#" instead.
> (Microsoft Word probably has some formula that dictates where the
> inserted text is put relative to the deleted text, but I can't figure
> out the pattern: it appears to be all over the map. What should
> definitely hold true, though, is that if I were to accept both the
> deletion and insertion, I would end up with pound signs before and
> after the number string. And ideally, the deletion and insertion would
> be done in blocks: all deleted characters together, and all inserted
> characters together.) But what actually happens is that the characters
> are inserted out of order, and in such a way as to make the replacement
> worthless for future use. Here is what comes out (with bolded
> characters representing the deleted characters, and underscores the
> inserted characters):
>
> claim c1laim 1##
>
> I can replace the pound signs in the replace string with anything I
> want, the result is the same (except that where the number is inserted
> into the deleted word "claim" depends on the length of the string I was
> putting before the number.
>
> The problem definitely relates to the use of wildcards: specifically,
> the use of the "Find what expression" in the Replace string (that is,
> the \1, \2, etc). I know this because if I were to search for
> "<([Cc][Ll][Aa][Ii][Mm]> )1" and replace it with \1#1#, the text "claim
> " is inserted before the deleted text, whereas the "#1#" is inserted
> after the deleted text. And if I were to do a find and replace without
> any "Find what expressions", all of the original text is deleted first,
> then all of the replacement text is inserted. But since I need to do
> this from within a macro, I have to use the "Find what expression" to
> do the search and replace.
>
> Any ideas?
>
> Thanks in advance.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a single word via find/replace wildcards Paul B. Microsoft Word Document Management 11 18th Jun 2010 01:52 PM
Help!!! Using WildCards for Find and Replace vvskpk Microsoft Powerpoint 0 11th Jan 2010 09:40 PM
Word Find/Replace Options - wildcards & formatting changes dd Microsoft Word Document Management 1 16th Oct 2009 06:24 AM
find and replace \n wildcards like word julesgf Microsoft Excel Misc 4 12th Feb 2009 03:11 AM
Find and Replace with wildcards? Colin Microsoft Excel Misc 4 20th Jan 2008 09:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:39 PM.