How To Run a WordBasic Macro from Within Visual FoxProLast reviewed: October 17, 1996Article ID: Q147195 |
The information in this article applies to:
SUMMARYTo run a WordBasic macro from within Visual FoxPro, you can use either OLE automation or DDE. In previous FoxPro versions, you must use DDE.
MORE INFORMATIONFor both of the following examples, it is assumed that a WordBasic macro named mymacro has been created. For more information on creating Word macros, please see Microsoft Word's Help file.
Example One (Using DDE)ichan = DDEInitiate("WinWord","System") *above command assumes that WinWord is running =DDEExecute(ichan,'[ToolsMacro "mymacro" ,.Run]') =DDETerminate(ichan)
Example Two (Using OLE automation)objWord = CREATEOBJECT("Word.Basic") objWord.ToolsMacro("mymacro",1) RELEASE objWord
|
Additional reference words: 5.00 3.00 3.00b VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |