Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if the Word is closed?
Message
De
23/11/2004 15:55:30
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00963921
Message ID:
00964023
Vues:
10
>I create & run MS Word MailMerge, but I don't want the user go back to VFP until he/she closed the Word Window. Untill now I use Cetin's MailMerge Class to find the window of teh MaiMerged Letters & go in a DO WHILE loop. But now some of my users have a MS Office builder in different languages so tha caption of the Form Letter Document vary due to language. So may question is How to know if the user closed the Word Window?
>
>
>myWord = CreateObject("Word.Application")
>**** do a Mail merge
>**** close all additional Word Windows as Main Document & DataSource
>DO WHILE FindWindow(0, "MicroSoft Word - Form Letters") # 0 && But "that caption now is varying :o(((
>  DO EVENTS
>ENDDO
>
Since you have an object reference, can't you just use code like this:

IF VARTYPE(myWord) <> "O" OR TYPE("myWord.Name") <> "C"
* The server has been closed
ENDIF

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform