Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 5.0 OLE Bound Control and Word'97
Message
De
24/07/1998 09:59:48
 
 
À
23/07/1998 08:24:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00119166
Message ID:
00120958
Vues:
28
>>>>If one embbeds a Word Document and then opens it for editing thePaper Width changes. The width varies depending on the width of thecontrol.Any solutions, suggestions to overcome this problem.ThanksSonali>For inplace editing it's a problem.>-Export file to disk.>-Open word in its own window>-Replace contents>-Erase doc.>CetinHi! Thanks for the idea. Could you pls. send me some code on how to dothis ( I'm rather new to OLE ). Also will the same code work for bothWord 6 and Word 97, or how can I detect which one is there in the system.ThanksSonali >Hi Sonali, >Idea might be good but I didn't say it's cumbersome. Anyway here the implementation code : >
* 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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform