>I have seen quite a lot of samples of VFP controlling Word or Excel, but I would like to see something the other way round - a Word macro that does something - anything - with Visual FoxPro. Any sample, to help me get started, would do.
>
I worked on a project a long time ago where we built a small COM object in VFP and called it from Word (and Excel and PowerPoint). The COM object retrieved and updated certain information.
So, in the VBA code, I had something like (and this is off the top of my head, and thus probably buggy):
DIM oVFP as MyVFPComObject.Whatever
oVFP = CREATEOBJECT("MyVFPComObject.Whatever")
oVFP.MyMethod(<some data from the document>)
OVFP = Nothing
The app in question was doing CRM and the staff was required to create all documents through the VFP app, but might close the VFP app after spawning the document. We had some things we wanted to do with the VFP data (actually, it was SQL Server, but that isn't really relevant) based on what the user did with the document.
Tamar