The information in this article applies to:
SYMPTOMSWhen using OLE automation to interact with Microsoft Word 97 and the Visual Basic for Applications language, certain commands return the following error to Visual FoxPro:
CAUSEThis problem is caused by a problem in the way Word 97 returns mismatched errors from the OLE DISPATCH methods. RESOLUTION
There are two ways to solve the error:
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 2.
Q170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why MORE INFORMATION
Starting with Word 97, OLE automation from other applications, such as
Visual FoxPro, can access the Word 97 Visual Basic for Applications (VBA)
objects by issuing the CreateObject("Word.Application") command in Visual
FoxPro. However, some of the methods used in Word 97 VBA return errors back
to the client application. When an error is returned to the client
application, like Visual FoxPro, it may be necessary to use older Word
Basic statements and functions in conjunction with the newer
Word.Application methods and properties. The purpose of the WordBasic
property is to return an Automation object (Word.Basic) that includes
methods for all the WordBasic statements and functions available in Word
version 6.0 and Word for Windows 95.
Steps to Reproduce BehaviorThe following code can be entered in the Command window, in a program, or in a method on a form:To avoid the above error, revert back to the WordBasic equivalent command. Replace the ActiveDocument.SaveAs above with the following line: Another option is to use only the Word.Basic object model. Enter the following code in the Command window, in a program, or in a method on a form:
REFERENCES
Microsoft Word for Windows 97 on-line help. Visual Basic for Applications
help that shipped with Word for Windows version 97.
Q169547 Some OLE Automation Commands Fail with Visual Fox Pro 5.x(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Dean Christopher, Microsoft Corporation Additional query words:
Keywords : kberrmsg kbVFp kbVS97sp1fix kbVS97sp2fix FxinteropOle FxinteropWinword |
Last Reviewed: August 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |