Article ID: 832580 - Last Review: July 1, 2005 - Revision: 4.1 Word 2002 stops responding and you receive an error message when you run a VBA macro that uses the .ReplaceAll propertyOn This PageSYMPTOMSWhen you run a Microsoft Visual Basic for Applications (VBA)
macro that uses the .ReplaceAll property in Microsoft Word 2002, Word 2002 may stop responding
(hang), and then you receive the following error message: Microsoft Word has encountered a problem and needs to close. We
are sorry for the inconvenience. AppName AppVer ModName ModVer Offset ------------------------------------------------------------ Winword.exe 10.0.5522.0 Winword.exe 10.0.5522.0 000170d6 CAUSEThis problem may occur if all the following conditions are
true:
RESOLUTIONHow to obtain the hotfixThis issue is fixed in the Word 2002 post-Service Pack 3 Hotfix Package May 5, 2004. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:830807
(http://support.microsoft.com/kb/830807/
)
Word 2002 post-Service Pack 3 hotfix package: May 5, 2004 MORE INFORMATIONTo set the AlternateReplaceAllMethodBehaviour registry
value, follow these steps:
815006
(http://support.microsoft.com/kb/815006/
)
WD2002: VBA Find.Execute ReplaceAll method does not return the original selection
For additional information about the Word
2002 security update, click the following article number to view the article in
the Microsoft Knowledge Base: 824934
(http://support.microsoft.com/kb/824934/
)
Overview of the Word 2002 Security Patch: September 3, 2003
For additional information, click the
following article number to view the article in the Microsoft Knowledge Base: 824684
(http://support.microsoft.com/kb/824684/
)
Description of the standard terminology that is used to describe Microsoft software updates
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this problem, do not use the
ActiveDocument object in your VBA macro or in automation to refer to a specific
document when several documents are open in Word 2002. Instead, use the objects
in the Documents collection to specify a document by name. For example, assume that you are opening two documents, "doc1.doc" and "doc2.doc". Edit and save the second document, doc2.doc. Instead of the following code, use this code: When you refer to the same document several times in your code, it is a good idea to define an object variable and set this to the document so that you can use the name of the variable whenever you want to refer to this specific document. See the following example: This will also make your code easier to read.
| Article Translations
|
Back to the top
