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:
00446307
Vues:
7
It is possible that different OS's behave differently...I'm on Win2K (don't know which SP at the moment) with VFP6 SP4. However, in this case, I don't think it's the problem.

I had been testing the original problem -- "how do you get Word out of the Task Manager?" However, in fixing the original problem, another cropped up because it wouldn't ERASE the file when executed just after the oWordApp.Quit method. Regardless of whether there's an oDoc.Close() method, Word removes itself from the Task Manager. However, the current problem is when trying to ERASE the file when complete. Word completes and gets out of Task Manager just fine on my machine, regardless of AllowFastSave and BackgroundSave. Add:

ERASE c:\temp\test.doc

at the end of your code, as that is now the problem that's causing the error. The settings of those properties don't matter...if you Close() the document before Quit(), ERASE works; if you don't Close the document, ERASE fails with a File Access Denied error.

- della

>It is possible that we are using different OS, and this is the reason we see different behavior. The following code works fine in my NT4 SP5 VFP6 SP3 environment:
oWordApp = CreateObject( "Word.Application" )
>oWordApp.Documents.Add()
>
>WITH oWordApp.Options
>   .AllowFastSave = .F.
>   .BackgroundSave = .F.
>ENDWITH
>
>oSelection = oWordApp.Selection()
>oSelection.TypeText( REPLICATE( "This is a test. ", 250000 ))
>
>oWordApp.ActiveDocument.SaveAs( "c:\temp\test.doc" )
>oWordApp.ActiveDocument.Close()
>oWordApp.Quit
>?? "Finished."
With the NT TaskMngr.Exe refreshing at it's quickest, WinWord.Exe can be seen to disappear before "Finished" is displayed in the VFP window.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform