Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make sure Word is gone
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00443950
Message ID:
00444355
Vues:
9
>>I know that I can use oword.quit(wdDoNotSaveChanges) to prevent the usual 'Do >you want to save the changes' dialog, but I don't have warm fuzzies that this >is the only thing that could cause word to pause quitting while waiting for an >answer.
>
>>I have discovered that successfully quitting word does not release local >object reference variables I use to access it, nor does it set them to NULL. >So checking for these conditions (existence and/or nullity) aren't helpful.
>
>1. oWord = CREATEOBJECT("word.application")
Alternatively:
LastOnError=on('error')
on Error oWord=.NULL.
oWord=getobject(,'Word.Application')
on error &LastOnError
if isnull(oWord)
oWord=createobject('Word.Application')
endif

>2. oWord.Quit()
maybe oWord=.NULL.
>3. release oWord
>4. oWord = ""
>
>I have also found that if you use CTRL-ALT-DEL at line 2 Winword is still running and at line 3 also but not at line 4.
Then that works! You've done it.
Sometimes a residual WinWord might ghost around inside the task manager. The thing to avoid would be multiple (unwanted) WinWords hanging around. The GETOBJECT function will (re) assign the application to object oWord, if winword is still live.
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform