The information in this article applies to:
SUMMARYThis article provides an example of how to programmatically update an OLE object embedded within a Word document. This example uses both Visual FoxPro 5.0 and Microsoft Word for Windows 95 version 7.0a. MORE INFORMATIONThe sample creates a new form and adds a Word object to that form. Next, the code activates the Word object to get a reference to its WordBasic object, deactivates it, and then automates the WordBasic object. The important part of this code is the temporary activation of Word. The object embedded in a form is called "Document." Unfortunately, Word does not support the object "Word.Document" through OLE Automation, but Word does support the object "WordBasic." The following line of code saves a reference to the object contained within the Word document:
This allows a programmer to update the object.
Please see the REFERENCES section of this article for additional information. Code ExamplePlace the following code in a program file and run it:
This code will replace the Visual FoxPro toolbars with the Word toolbars
in order to edit the embedded Word object.
REFERENCESFor more information about OLE Automation, Visual FoxPro, and Word, please see the following articles in the Microsoft Knowledge Base: Q138205 HOWTO: Use OLE Automation with Microsoft Word Q148474 SAMPLE: Ole_samp.exe to Microsoft Excel, Word, & PowerPoint Q105535 Word for Windows Supports OLE Automation as a Server Only Additional query words:
Keywords : kbinterop kbAutomation kbVFp500 kbVFp600 |
Last Reviewed: August 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |