Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bind Events to a Word.document object
Message
From
22/02/2002 12:41:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Bind Events to a Word.document object
Miscellaneous
Thread ID:
00623782
Message ID:
00623782
Views:
62
I have successfully bound to a Word Document and am firing code in the documentevents_close procedure as follows:
IF oCBEvents.llLoaded = .f.
     oCBEvents.llStop = .t.
&&	need to force word not to close yet.  canceldefault?!!
ENDIF
oCBEvents is an Commandbarbutton object. It is designed to load several buttons to a custom commmandbar. That load process takes a few seconds.

Here's the problem, during those few seconds if a user closes the Word Document, I need the Commandbarbutton to stop creating. If it continues to load it will no longer have access to the document that it is trying to add itself to. Resulting in an error.

Here's the question. Is there a nodefault equivalent that I could put in place of my commented code?

I've actually narrowed the few seconds down to the time it takes to run a couple of lines of code. This was done by setting property (oCBEvents.llStop = .t.) then exiting out of the commanbar creation. But still have the problem if the user closes during those few lines of Code.

Thanks, John
Next
Reply
Map
View

Click here to load this message in the networking platform