Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open a word doc in modal form??
Message
De
19/06/2007 10:20:45
 
 
À
19/06/2007 10:03:03
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01234220
Message ID:
01234258
Vues:
37
>>>can I open a worddoc so it is in a modal window?
>>>so my program waits until word gets closed??
>>>
>>>
>>>Thanks
>>>
>>>
>>>peter
>>
>>You can just initiate Word from VFP modal form and disallow its closing until Word is closed by, for example, checking if WordApplication object is still an object.
>
>cool. That might work
>I'll try it
>[UPDATE]
>the following does not work:
>
>Local oWord as word.application , cDoc as Character
>cDoc= ADDBS(SYS(5)+SYS(2003))+ALLTRIM(thisform.business.data.fpath)
>oWord=Createobject("word.application")	&& Create word object
>oWord.documents.Open(cDoc)
>oWord.Visible=.t.
>SET ESCAPE ON
>DO WHILE VARTYPE(oWord)="O"
>	_vfp.Visible=.F.
>	ON ESCAPE exit
>	WAIT WINDOW TIMEOUT  2 VARTYPE(oWord)
>ENDDO
>_vfp.Visible=.t.
>
>
>the type of oWord does not change after I exit word
>
>
>Peter

You should do it differently:
1. Link oWord to form property, i.e.
Thisform.oWordapp=Createobject("word.application")
2. Check VarType(Thisform.oWordapp) and IsNull(Thisform.oWordapp) in Form.QueryUnload to prevent closing.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform