Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make sure Word is gone
Message
From
27/11/2000 16:30:48
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00443950
Message ID:
00445863
Views:
15
>
>Try adding a DOEVENTS after quit, and another after the copy. I think VFP simply fires off each line and doesn't wait for Windows events to process before proceeding. DOEVENTS will likely solve that.

Well, the DOEVENTS looked hopeful, but does not seem to do the trick. I placed a DOEVENTS right after the QUIT and I still get a 'file access denied' when I subsequently try to erase the document I was working on.

The errant code has the following form

oword.quit(wdSaveChanges)
DOEVENTS
dosomeotherstuff
ERASE

If I break on the quit line, then continue, I get the file access denied error.
If I break on the DOEVENTS line (or any other line before the erase), the ERASE succeeds.

However, I was able to make things work the way I want them to by issueing a document.close prior to quitting (had to do this anyway due to suggestions in my other thread 'How to make sure word is gone'). So now I have

omydoc.close(wdSaveChanges)
if oword.documents.count < 1
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Reply
Map
View

Click here to load this message in the networking platform