Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't force MS word window on top
Message
De
01/10/2004 10:44:51
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00947818
Message ID:
00947945
Vues:
17
Hi Sergey,

I tried that too after I posted. It still didn't work. In the meantime I created a simple modal form to mimic the message box, and I execute that instead of the messagebox. This solves the problem.

I don't really understand why. I'm guessing it has to do with the fact that messagebox() is a windows system window, not native vfp? But I'm not too familiar with those types of things.

Robert,

I'll try the oword.application.activate as well to see if it makes a difference.

Thanks as always for your input.


>David,
>
>Just a guess, try to show messagebox before you instantiate word object
Messagebox( ...
>oad= Thisform.oword.documents.Open(lcNewfileName)
>
>
>>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
Fil
Voir

Click here to load this message in the networking platform