Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Viewing/amending word document from VFP form
Message
De
13/05/2003 03:50:44
 
 
À
12/05/2003 11:57:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00787305
Message ID:
00787600
Vues:
17
Cetin

Thanks for that, I'll let you know how I get on.

Kev

>>>>>>Hi
>>>>>>
>>>>>>Is there a way of viewing/amending MS word documents from VFP Forms? I want just the document window alone, and have my own buttons on the VFP form performing API calls to the Word OM.
>>>>>>
>>>>>>Any ideas?
>>>>>>
>>>>>>Thanks
>>>>>>Kev
>>>>>
>>>>>Kevin,
>>>>>I don't suggest it to do but you could add an OleControl with a documentfile property set to a doc.
>>>>>Alternatively you could use a webbrowser control and navigate to a doc (better IMHO).
>>>>>
>>>>>PS:My own preference is to use word in its own window.
>>>>>Cetin
>>>>
>>>>Cetin
>>>>
>>>>Could I open it in it's own window and hide "everything" except the document?
>>>>
>>>>Thanks
>>>>Kev
>>>
>>>AFAIK yes. But never tried to do so.
>>>Cetin
>>
>>That's a shame, because I'm not getting very good results searching on the internet for things like this.
>>
>>Do you know how to attach a document to the documentfile property? It appears to be readonly.
>>
>>Thanks
>>Kev
>
>Kevin,
>Any code similar to this one would do (VFP6 SP3 and later):
>
>lcDocument = Getfile('DOC')
>Set Textmerge To Memvar myVar Noshow
>Set Textmerge On
>\DEFINE CLASS oleWordObject as OLEControl
>\	OleClass ="Word.document"		&& Server name
>\	OleTypeAllowed = 0 					&& Linked
>\	DocumentFile = "<<lcDocument>>"	&& This file should exist
>\ENDDEFINE
>Set Textmerge To
>Set Textmerge Off
>lcTempClass = Sys(2015)+'.prg'
>Strtofile(myVar, lcTempClass)
>Compile (lcTempClass)
>
>oform = Createobject("myForm")
>With oform
>  .Height = 420
>  .Width = 620
>  .Newobject("WordObject","oleWordObject",lcTempClass)  && Add OLE object
>  With .WordObject
>    .Left = 5
>    .Top = 5
>    .Width = .Parent.Width - 10
>    .Height = .Parent.Height - 10
>    .Visible = .T.
>  Endwith
>Endwith
>oform.Show
>Read Events
>Clear Class 'oleWordObject'
>Erase (Juststem(lcTempClass)+'.*')
>
>Define Class myForm As Form
>  Procedure QueryUnload
>    Clear Events
>  EndProc
>Enddefine
>
However I have real doubts about this one or one using OleBoundControl instead it would be good to work with. Working with object model in this fashion has always been frustrating to me.
>Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform