Hi:
Above the solution for your problem (i.e. bug):
When 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:
OLE error code 0x80020005: Type Mismatch.
This problem is caused by a problem in the way Word 97 returns mismatched
errors from the OLE DISPATCH methods.
There are two ways to solve the error:
1. Use the equivalent Word.Basic methods with the WordBasic property
within the Word.Application object. See the example below.
2. Use only the Word.Basic object.
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.
Thanks,
Alexander August