ID: Q147195
The information in this article applies to:
To run a WordBasic macro from within Visual FoxPro, you can use either OLE automation or DDE. In previous FoxPro versions, you must use DDE.
For 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.
ichan = DDEInitiate("WinWord","System")
*above command assumes that WinWord is running
=DDEExecute(ichan,'[ToolsMacro "mymacro" ,.Run]')
=DDETerminate(ichan)
objWord = CREATEOBJECT("Word.Basic")
objWord.ToolsMacro("mymacro",1)
RELEASE objWord
Additional query words:
Keywords : kbcode kbinterop kbVFp300 kbVFp500 kbVFp600
Issue type : kbhowto
Last Reviewed: October 22, 1998