Information générale
Catégorie:
COM/DCOM et OLE Automation
Does
oword.application.activate
instead of
oword.activate
make a difference?
>I have am calling word automation from vfp 7. It's a simple application. The user highlights a document name in a grid. The application then opens the word file for editing. I want the word application to be on top of the vfp application.
>
>I've seen posts on here (somewhere from Cetin - I think) indicating that issuing the activate is 'usually sufficient' to bring word on top.
>
>
>The following code brings the word window to the top:
>oad= Thisform.oword.documents.Open(lcNewfileName)
>WAIT clear
>thisform.oword.visible=.t.
>Thisform.oword.Activate()
>
>But the problem is that I want to display a message to the user before I bring word to the top. For some reason, if I insert a messagebox() before calling the activate code, it doesn't bring it to the top????
>
>The following code DOES NOT work:
>oad= Thisform.oword.documents.Open(lcNewfileName)
>WAIT clear
>
>Messagebox('The file ' + lcNewfileName + 'is now available in Microsoft Word for editing' + Chr(13)+Chr(10) + ;
> 'Click OK to begin editing the file',0+64,'Document Management System')
>thisform.oword.visible=.t.
>Thisform.oword.Activate()
>
>Why does the messagebox() have an effect on this. I am stumped. There were some other posts about using the findwindow API. Will I need to resort to using that?
>
>
>
>
>
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement