* Form has OLEBoundControl named oOLEObj
>* control.source a Gen field with embedded word doc
>* This code could be a commandbutton!s click or
>* cover the oOleObj with a transparent shape
>* and put this in shape.dblclick
>local lcTempFile
>wait window nowait "Opening word..."
>lcTempFile = sys(5)+curdir()+"T"+sys(2015)+".doc"
>nlLocaleId=sys(3004) && Save local id
>=sys(3006,1033) && We will be sending instructions in English
>thisform.oOLEobj.object.saveas(lcTempFile)
>oWord = createobject("word.basic") && So don't bother if 6.0 or 8.0
>* 8.0 can be called either createobject("word.basic")
>* or createobject("word.application") - this one has wordbasic object
>* to use word.basic commands also (not all work as should)
>with oWord
> .appshow
> .fileopen(lcTempFile)
>endwith
>wait clear
>lnHandle = fopen(lcTempFile,12)
>do while lnHandle < 0 && Suspend VFP till word exits
> lnHandle = fopen(lcTempFile,12)
>enddo
>=fclose(lnHandle)
>release oWord
>blank field WordDoc
>append general WordDoc from (lcTempFile)
>erase (lcTempFile)
>thisform.refresh
>
>Since used commands here work with createobject("word.basic") in versions 6.0-8.0 no need to detect version. And more it's so annoying version info is obtained differently in different versions (or someone else made appinfo$() work in both versions and I don't know how to do yet)! How would I know which one to use before I know the version is a mystery (to me) w/o using dumb workarounds such as trying to createobject("word.application") or hacking the registry. But still it's called automation.
>.....
Thanks for sending me the code, it was extremly usefull. I still find
that if the document is embedded then the paper width changes so I plan to link them.
Another small request was were can I find a help detailing the Object & Methods exposed by MS Word and MS Graph.
Thanks for all the Help. Sonali