>Yes, it is possible. We are currently working on a project which has a component that does exactly this.
>
>The gist of it is that you need to create a VFP COM component that either has set/get methods or exposes properties to let you retrieve values from a table, and a save or update method.
>Create the COM object from within Word and reference it's properties to populate the document. Then either trap change events or the save event from Word, modify the values in the COM object and call the COM object save to write to disk.
>
>If you need some specifics I can probably provide you with some.
>
>>Hello All,
>>a user on my current site asked me if it is possible to enter a value from within Word ( form field ) ( e.g. a PK value ) and automatically populate some other form fields on the form from Foxpro tables, I recalled an article from Foxtalk Mar 97 by J. V. Petersen, which demonstrated a similar scenario using OLE servers, but did not show a Word example, I'm quite confident of the VFP side but how do I reference Word merge field values?, apologies if this seems a tad on the vague side but what are friends for?
>>
>>Regards
>>Pete Kane
Eric & Nancy & All,
thanks for your reply, I have no problem with the concept of how to do this, my problem is how to reference the merge fields from within Word, what I've done so far is created a COM object in VFP, the Init opens a table and sets the order, and another method GetDetails populates some member props that I can use in Word, BUT having retrieved the data how do I populate my WORD fields with the values? my macro in Word is like this
dim ox as object
set ox = createobject("vfpcom.vfpcom")
ox.GetDetails("MyPrimaryKeyValue")
name = ox.name
address = ox.address
telephone = ox.telephone
what I don't know how to do is say: mywordfield.value = name
Regards
Pete Kane
Nancy,
sorry if I didn't make myself clear, the problem is my lack of VBA
Cheers
Regards,
Peter J. Kane
Pete