Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WORD automation and busy signals
Message
From
14/01/2001 21:35:19
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00463296
Message ID:
00463637
Views:
12
Hi Vlad,

Thank you for your advise. But once again Cetin has figured it out for us. Look at his response to my question and you will find that he truly understands this beast. I tried playing around with the OLE variables prior to putting out the question on the thread . VFP still fell thru the do while loop although I was able to silence the error dialog. It seems that Cetin's fix prevents the error dialog from being generated, it prevents the busy signal from coming back to vfp and it prevents VFP from falling through the do while loop. Remember that the loop was there to keep vfp in a wait state, not to exucute any code until the user manually QUIT WORD.

Thanx,
Neil

Hi!
>
>Try to play around following variables:
>
>_VFP.OLERequestPendingTimeout
>_VFP.OLEServerBusyRaiseError
>_VFP.OLEServerBusyTimeout
>
>Probably you require to use
>_VFP.OLEServerBusyRaiseError = .F.
>
>before any operations with word.
>
>
>>>I allow my users to use WORD via automation in one of my apps. I instantiate WORD, via oo = createobj("word.application"), and then make it visible to the user. The user has full access to all of WORD'S features. While the user is in WORD I loop, in a kind of wait state, so that WORD stays on the DeskTop until the user QUITS WORD. That works fine but yesterday someone revealed a problem. If the user opens a modal dialog while in WORD and stays in it for approx. 20 seconds, while I am looping, vfp has an error dialog waiting for you indicating that the automation server is busy. I guess that is really accurate. WORD is actually very busy in the modal dialog and can't take any commands at the moment. BUT, I am just looping within vfp and just want to know when the user QUITS WORD.
>>>
>>>ANY THOUGHTS??
>>>
>>>
>>>***
>>>It is something with how vfp and automation work. VFP thinks that the automation server is **BUSY** whenever a modal dialog is able to stay on the screen for approx. 20 seconds.
>>>Try this:
>>>
>>>** create WORD server
>>>oo = createobject("word.application")
>>>oo.visible = .t.
>>>** maximize WORD
>>>oo.windowstate = 1
>>>
>>>** When Word comes up on the DeskTop Try This:
>>>** click on TOOLS, CUSTOMIZE. Keep the Customize dialog on the screen for
>>>** 20 seconds. Minimize WORD and look at the error waiting for you in vfp.
>>>** In Fact, this will happen if you open any modal dialog in WORD and stick around for 20 seconds.
>>>** I have simulated this error directly from the Command Window. Simply type
>>>** oo = createobj("word.application") in the command window. Control WORD via the
>>>** oo reference. Activate a WORD modal dialog and then try to use the oo referencce
>>>** in the command window. You get the same error. ANY THOUGHTS??
>>>
>>>** create wait state to keep WORD on DeskTop
>>>** without this, the "do returnme" would fire before user closed word
>>>do while type("oo.displayrecentfiles")# "U" && works only in word 2000
>>> = inkey(.5)
>>>enddo
>>>do returnme
>>>messagebox("You closed WORD")
>>>oo = .null.
>>>release oo
>>>messagebox("Automation Reference Is Gone")
>>>
>>>procedure returnme
>>>messagebox("You are in Procedure: Returnme")
>>>
>>>Thanx
>>>Dr. G. (Neil)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform