BUG: Automation client receives error or crashes calling Word's Find object (292744)
The information in this article applies to:
- Microsoft Office Word 2003
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Word 97 for Windows
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
This article was previously published under Q292744 SYMPTOMS When you use an out-of-process client application that uses
early binding to Automate Word 97 or later, the application may crash with an
access violation or you may receive one of the following error
messages: From Microsoft Visual Basic: Run-time error '-2147023113
(800706f7)': The method '~' of object '~' failed Run-time error '-2147023113 (800706f7)': Method 'Execute' of
object 'Find' failed Run-time error 430:
Class does not support automation or does not support expected interface.
From Microsoft Visual C++: HRESULT = 0x800706F7
RPC_X_BAD_STUB_DATA - The stub received bad data. NOTE: In debug builds you receive a corrupt stack warning from an
Assert dialog box, and the value of EAX is that listed above. In release
builds, the stack corruption will likely crash the application soon after this
point, but the HRESULT value is likely to be similar to the above.
The problem occurs consistently on some computers, but may never occur on
others. Installing a new application or a Microsoft Excel service pack can
cause a computer that was working previously to experience the problem.
CAUSE Several globally unique identifiers (GUIDs) that are used
by Word for its interface identifiers were used by Excel version 5.0 for an
older object model that is now obsolete. When the Excel 5.0 type
library is reregistered on a system, the interface GUIDs in the registry that
should point to the Word type library point to the Excel 5.0 library, and COM
can mistakenly construct the wrong proxy v-table for an out-of-process client
using early binding to Word. Calls that are made to this proxy return errors or
crash because the proxy is configured for a dispinterface for Excel instead of
for the expected Word interface. The following GUIDs are duplicated
in the Excel 5.0 type library and the Word 8.0, 8.1, 10.0 and 11.0 type
libraries:
Interface ID (GUID) |
Word Interface |
Excel 5.0
Dispinterface |
{000209B1-0000-0000-C000-000000000046} |
Replacement |
Worksheets |
{000209AD-0000-0000-C000-000000000046} |
Dictionary |
Module |
{000209AE-0000-0000-C000-000000000046} |
ReadabilityStatistics |
Modules |
{000209AF-0000-0000-C000-000000000046} |
ReadabilityStatistic |
DialogSheet |
{000209B0-0000-0000-C000-000000000046} |
Find |
DialogSheets |
If the Word type library is properly registered, COM
constructs the correct proxy and the out-of-process calls function normally.
RESOLUTION To resolve this problem, do one of the following:
- Modify your code to use late binding when you call methods
or properties on any of the above listed Word interfaces. -or-
- Reregister the Word type library on the system on which the
problem occurs.
The recommended solution is to use late binding. Because both
type libraries describe interfaces that implement the IDispatch interface, calls to any of the IDispatch methods work regardless of which library was last registered on
the system. This is the only way to be sure that your code does not encounter
this error on systems that you do not administer. For customers that
use client applications that cannot be recompiled to use late binding, you can
reregister the Word type library to resolve the problem in most cases. Because
the problem returns if the Excel 5.0 library is reregistered again, this is not
an ideal resolution. However, the chances of the Excel 5.0 library being
reregistered are low, so this method should work for most users. To
reregister the Word type library, find the appropriate type library for the
version of Word that is installed on the system:
Version | Library Name |
Word 97 | msword8.olb |
Word 2000 | msword9.olb |
Word 2002 | msword.olb |
Word 2003 | msword.olb |
Then, from the command line, use Regtlib.exe with the
full path to the type library to reregister the library for COM. Regtlib.exe
calls the LoadTypeLib and RegisterTypeLib application program interfaces (APIs) on the type library (.tlb
or .olb) file that is passed in. COM repairs the misconfigured registry
keys. Regtlib.exe is included in the Windows Libraries Update.
For additional information about the Libraries Update, click the following article number to view the article in the Microsoft Knowledge Base:
197298
INFO: Microsoft Libraries Update:
What, Where, Why
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 3/23/2006 |
---|
Keywords: | kbAutomation kbbug kbnofix KB292744 |
---|
|