Conditional hyphens can cause Word 2007 SP1 Find & Replace to hang

N

Neil Cumfer

Thanks for investigating and responding.
A thing I noticed:
If the cursor is in the same paragraph as the text you're searching for,
"Find" or "Find/Replace" never seems to hang.
I would say "never: but yes, the Service Pack 1 bug is causing the Find
and Replace Dialog Box to lose track of where it is in the document, at
a certain point it keeps rechecking the same location and gets trapped
in an endless loop. In some documents, you can watch the progress meter
on the status bar and see the progress bar shrink and expand as the
cursor keeps advancing and retreating during the replace all operation.

(I will also respond to your followup post)
 
N

Neil Cumfer

I don't think the problem is in the document at all. It worked fine
before applying Service Pack 1. Locating the portion in the document
where the bug strikes can help with creating a workaround.
If I cut the soft hyphen (either by itself, or with some more text following
it) and then use "Undo", that fixes the problem for the moment, too.
But if I close and re-open the file, the problem reappears.

I have seen something similar too.

When reproducing the bug as described in an earlier message ...
STEPS TO REPRODUCE:
1. Open the identified affected version of Word.
2. (Optional for readability, does not affect test case) On the Home
tab, in the Paragraph group, click Show/Hide to show formatting marks.
3. Type the word "Test"
4. Press the Enter key
5. Press the Tab key
6. Press the Enter key
7. Press Ctrl+- (Control + Hyphen) twice.
8. Press the Enter key
9. On the Home tab, in the Editing group, click Replace.
10. For 'Find what', enter "Test", and for 'Replace with', enter "Testing"
11. Click Replace All.
12. Observe that Word stops responding. Task Manager can be used to
verify that Word is consuming as much CPU as possible (up to 100%)

... I noticed that I can copy the first conditional hyphen to the
clipboard and paste it between the two consecutive conditional hyphens,
then delete the first conditional hyphen, and suddenly the Replace All
button will work without causing Word 2007 SP1 to freeze.

I have developed a workaround for my problem files. I have discovered
that if I replace each space character with a space character, it will
trick Service Pack 1 into letting me perform the replacement that
otherwise would cause Word 2007 SP1 to freeze up. This workaround does
not work for the document with the two conditional hyphens, however.

It appears to me that something in SP1 is causing the Find and Replace
Dialog Box to become corrupted (or possibly something in SP1 is causing
Word 2007 to corrupt some documents when it opens them).

Thanks again.

Neil
 
K

Klaus Linke

Hi Neil,

Thanks for the info!

I was a bit obscure in my posts: Word often hangs for me even if there are
no double optional hyphens (soft hyphens), only single ones.
My work-around right now is to replace all of them with some other Unicode
character, or delete them if possible.

When there's some time (next weekend?), I'll do some testing with your
"STEPS TO REPRODUCE" and then try to file a bug report.

Thanks again,
Klaus
 
B

Bob Buckland ?:-\)

Hi Neil,

FWIW, repeating the 'Steps to Reproduce', even with the unlikely document content <g>, Word 2007 SP1 doesn't hang for me on doing
the replace.

It's possible that there's something in the documents that Word is 'seeing' that does this. Do you have webpage/blog/Office Live
Workspace/file share site, etc that you can use to provide a link to a .docX document that you're seeing this in?

If you start Word 2007 in safe mode (hold ctrl key while starting Word and repeat the 'steps to reproduce' do you get the same hang?

One of the possibilities in the original messages in this thread is that it may be related to specific language settings or with a
mix of Left-to-Right and Right-to-left languages being involved in a document.

What is the build level for Word 2007 (Alt, F, I, R)?

=========
I don't think the problem is in the document at all. It worked fine
before applying Service Pack 1. Locating the portion in the document
where the bug strikes can help with creating a workaround.
If I cut the soft hyphen (either by itself, or with some more text following
it) and then use "Undo", that fixes the problem for the moment, too.
But if I close and re-open the file, the problem reappears.

I have seen something similar too.

When reproducing the bug as described in an earlier message ...
STEPS TO REPRODUCE:
1. Open the identified affected version of Word.
2. (Optional for readability, does not affect test case) On the Home
tab, in the Paragraph group, click Show/Hide to show formatting marks.
3. Type the word "Test"
4. Press the Enter key
5. Press the Tab key
6. Press the Enter key
7. Press Ctrl+- (Control + Hyphen) twice.
8. Press the Enter key
9. On the Home tab, in the Editing group, click Replace.
10. For 'Find what', enter "Test", and for 'Replace with', enter "Testing"
11. Click Replace All.
12. Observe that Word stops responding. Task Manager can be used to
verify that Word is consuming as much CPU as possible (up to 100%)

... I noticed that I can copy the first conditional hyphen to the
clipboard and paste it between the two consecutive conditional hyphens,
then delete the first conditional hyphen, and suddenly the Replace All
button will work without causing Word 2007 SP1 to freeze.

I have developed a workaround for my problem files. I have discovered
that if I replace each space character with a space character, it will
trick Service Pack 1 into letting me perform the replacement that
otherwise would cause Word 2007 SP1 to freeze up. This workaround does
not work for the document with the two conditional hyphens, however.

It appears to me that something in SP1 is causing the Find and Replace
Dialog Box to become corrupted (or possibly something in SP1 is causing
Word 2007 to corrupt some documents when it opens them).

Thanks again.

Neil >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
N

Neil Cumfer

Hi Bob,

The problem started immediately after installing Service Pack 1 ...
since it doesn't happen to everybody, it could be a faulty install, but
Microsoft won't let you reinstall or uninstall the service pack. I have
repaired the entire installation of Office 2007 to no avail.

Also, the problem manifests itself in safe mode.

I don't think the right-to-left languages are involved, my only enabled
language is English (US).

In my mind, the problem is that the Find and Replace dialog box is in a
corrupt state. The service pack attempted to fix many problems with
various languages ... maybe a certain language has to be installed in
order for the service pack to install correctly.

My build is Word 2007 (12.0.6212.1000) SP1 MSO (12.0.6213.1000)
(hmm I see that the service pack is for 6213 but I have 6212)

You can download a .doc file from our website
http://intranet.scstatehouse.net/reports/hupdate/hupdate.htm ... just
about any link in the "2008 Issues" section (the May 6 issue is one of
the shortest http://intranet.scstatehouse.net/reports/hupdate/8n17.doc).

These documents don't have hyphens but they do have paragraphs beginning
with tabs and Word freezes (for me) when I try to replace ^p^w with ^p

Thanks for any help you can provide.

Neil

Bob Buckland ?:-) said:
Hi Neil,

FWIW, repeating the 'Steps to Reproduce', even with the unlikely
the replace.

It's possible that there's something in the documents that Word is
'seeing' that does this. Do you have webpage/blog/Office Live
Workspace/file share site, etc that you can use to provide a link to a
..docX document that you're seeing this in?
If you start Word 2007 in safe mode (hold ctrl key while starting Word
and repeat the 'steps to reproduce' do you get the same hang?
One of the possibilities in the original messages in this thread is
that it may be related to specific language settings or with a
 
N

Neil Cumfer

OK, the "steps to reproduce" were posted a while back by somebody else,
it seems that when some people follow the steps they can see the
problem,
but when other people follow the steps they can't.
 
B

Bob Buckland ?:-\)

Hi Neil,

Yes, in those files I do get the issue. Word 2007 has trouble, going into a 100% CPU, use when the Replace dialog looks for two
consecutive formatting code sequences, such as ^p^p or ^p^w

It can usually handle either of those separately but not the pair in some cases. That was the case here,
http://www.scstatehouse.net/reports/hupdate/8n17.doc
but so far none of the previous workarounds (i.e. replace ^p with ^& or first replacing ^p with text such as 'FRED', then do the
^p^w or FRED^w replace) has worked on that file, even when saved as XML, so I'm still looking at them and hopefully others might do
so as well. :)

The dialog doesn't hang the system for me (i.e. while it won't respond to the mouse trying to close the dialog it does seem to
respond to cancelling by the Esc key in most cases) and eventually the progress dialog on the bottom of the screen does start to
creep forward.

=================
Hi Bob,

The problem started immediately after installing Service Pack 1 ...
since it doesn't happen to everybody, it could be a faulty install, but
Microsoft won't let you reinstall or uninstall the service pack. I have
repaired the entire installation of Office 2007 to no avail.

Also, the problem manifests itself in safe mode.

I don't think the right-to-left languages are involved, my only enabled
language is English (US).

In my mind, the problem is that the Find and Replace dialog box is in a
corrupt state. The service pack attempted to fix many problems with
various languages ... maybe a certain language has to be installed in
order for the service pack to install correctly.

My build is Word 2007 (12.0.6212.1000) SP1 MSO (12.0.6213.1000)
(hmm I see that the service pack is for 6213 but I have 6212)

You can download a .doc file from our website
http://intranet.scstatehouse.net/reports/hupdate/hupdate.htm ... just
about any link in the "2008 Issues" section (the May 6 issue is one of
the shortest http://intranet.scstatehouse.net/reports/hupdate/8n17.doc).

These documents don't have hyphens but they do have paragraphs beginning
with tabs and Word freezes (for me) when I try to replace ^p^w with ^p

Thanks for any help you can provide.

Neil >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
N

Neil Cumfer

Hi Bob,

Thanks for fooling around with it.

As a workaround for this particular file, I can replace every space
character in the document with another space (I use ^0032 in the find
box and a space in the replace box). That seems to temporarily remove
the corruption in the dialog box and can be followed by a successful
replacement of ^p^w

I have also discovered that the escape key will restore order (might
have to wait a couple of second), but if you click on the Cancel button
or the X in the upper right corner, that title bar of the dialog box
will change to Not Responding ... I guess the reports have been
misleading because it is not actually Word that is hanging but the
dialog box

I have been using ^p^w for years and never had a problem with it until
Service Pack 1 for Word 2007

I think we might have explored this bug as far as anybody on the outside
can go ... of course, all you readers are welcome to prove me wrong :)

Neil


Bob Buckland ?:-) said:
Hi Neil,

Yes, in those files I do get the issue. Word 2007 has trouble, going
into a 100% CPU, use when the Replace dialog looks for two
consecutive formatting code sequences, such as ^p^p or ^p^w

It can usually handle either of those separately but not the pair in
some cases. That was the case here,
http://www.scstatehouse.net/reports/hupdate/8n17.doc
but so far none of the previous workarounds (i.e. replace ^p with ^&
or first replacing ^p with text such as 'FRED', then do the
^p^w or FRED^w replace) has worked on that file, even when saved as
XML, so I'm still looking at them and hopefully others might do
so as well. :)

The dialog doesn't hang the system for me (i.e. while it won't respond
to the mouse trying to close the dialog it does seem to
respond to cancelling by the Esc key in most cases) and eventually the
progress dialog on the bottom of the screen does start to
 
G

Gharib

Hello,

Thanks for the Esc suggestion. This seems to restore order, as you
mentioned, and saves the huslte of restarting Word everytime.

I agree that my theory about track changes was not correct. There are also
no particular patterns that are specific to the problem from what I can see,
except perhaps Arabic files in the cases I have experienced. I do have a file
where most attempts to search, even without replace, seems to end up in this
endless loop. I will try to make this file available once I have my client's
permission.

One observation I found, is that in some of the cases that did not hang, I
found that after the completion of the search and replace, the file context
did end up in the "track changes" pane, and a string was highlighted, this
was one of the strins that were changed.

Regards,

Alaa Zeineldine
 
S

Scott Beadenkopf

I have been experiencing similar problems, also with Word 2007 SP1, also
(12.0.6212.1000) SP1 MSO (12.0.6213.1000) , replacing " ^p" with "^p" (to
remove the space preceeding the CR), even in a very simple text file.

On the "AllExperts" forum, Mahesh Khilare suggests searching for "^13"
instead of "^p", but replacing with "^p". This solution worked for me.

I checked in a hex editor, to make sure that the "0D0A" (CRLF) was still
"0D0A". I have not tested extensively, but the work around generally seems
to work well.
 
K

Klaus Linke

Scott Beadenkopf said:
I have been experiencing similar problems, also with Word 2007 SP1, also
(12.0.6212.1000) SP1 MSO (12.0.6213.1000) , replacing " ^p" with "^p" (to
remove the space preceeding the CR), even in a very simple text file.

On the "AllExperts" forum, Mahesh Khilare suggests searching for "^13"
instead of "^p", but replacing with "^p". This solution worked for me.

I checked in a hex editor, to make sure that the "0D0A" (CRLF) was still
"0D0A". I have not tested extensively, but the work around generally
seems
to work well.

That's a bug that has been around a while. It seems to hit in non-Word
formats only (*.txt, WordPerfect...), so if you work on such docs and need
to do replacements, it's best to save in Word format (*.doc, *.docx ...)
first... Or use your work-around.

Klaus
 
R

Roger Noar

Hi,
I have the same problem with Word 2007 with the following search/replace.
This codebelow works fine with Word 2000, and 2003. With Word 2007, it hangs
with 100% CPU until Esc is pressed.

Apparently Word 2007 has a problem with certain complex searcges containing
^p . A simple ^p search works just fine. So my workaround was to first do a
search/replace to replace all ^p with an identifier code - suchas "ZZ8" and
then do a search/replace on ^lZZ8 instead of ^l^p .


Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l^p"
.Replacement.Text = "^l"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
 
B

Bob Buckland ?:-\)

Hi Roger,

Does the text you're searching include conditional hyphens or a mix of
Left-to-Right and Right-to-Left languages?

If you change the direction of search from 'down' to 'up', manually or via your macro, does the 'hang' still occur?

If you phone Microsoft for this hotfix (no charge if you let them know you're calling for a hotfix)
http://support.microsoft.com/kb/955587?FR=1
and install the hotfix, does the search still have the same problem?

==================
Hi,
I have the same problem with Word 2007 with the following search/replace.
This codebelow works fine with Word 2000, and 2003. With Word 2007, it hangs
with 100% CPU until Esc is pressed.

Apparently Word 2007 has a problem with certain complex searcges containing
^p . A simple ^p search works just fine. So my workaround was to first do a
search/replace to replace all ^p with an identifier code - suchas "ZZ8" and
then do a search/replace on ^lZZ8 instead of ^l^p .


Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l^p"
.Replacement.Text = "^l"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll >>
--

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*
 
R

Rincon Administrator

I Also Have seen this happen in multiple environments. Microsoft really needs
to get a fix for this fast, my customers don't like it when I have to blame
MS for their headaches and tell them there's nothing that can be done...
 

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