Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect Word has been closed.
Message
 
À
23/03/2001 13:00:43
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00488111
Message ID:
00488160
Vues:
9
Thanks Daniel. Your suggestion works great. I decided to use Vlad's suggestion because I found during testing it allowed me to close Word or close the document and not Word and continue with my app in either case.

Re: "Be careful with this as the user may have Word open..." I found neither Vlad's or your suggestion had a problem with this because even if Word was open, I'm opening a new instance.

Thanks for the input. I can already think of other uses for your TYPE() suggestion as well.

>Colin:
>
>> I want to do 2 things here.
>> 1. I don't want the user to be able to return to my app until they finish
>> and close Word.
>
>Be careful with this as the user may have Word open for something other than
>to modify a document generated by your application and they find it rude
>that you force them to close Word to go back to your app.
>
>Are they editing a letter that you want to store in a record displayed on the
>active form?
>
>> 2. I need to know how to detect when Word is closed. I've discovered that
>> the object reference remains even after closing Word.
>
>The object reference remains (VARTYPE() returns 'O') but it is invalid.
>Accessing any property or method or the RPC Server will raise an error 1426
>that you can trap. Also, when a reference is invalid,
>TYPE('loWord.AnyProperty') returns 'U'.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform