Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WORD automation busy signal??
Message
De
12/01/2001 11:09:04
 
 
À
12/01/2001 11:00:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00462984
Message ID:
00462993
Vues:
14
Hi Neil,

I think that INKEY() loop is messing you up. You are constantly querying a Word property while the user is doing stuff that may involve a modal screen in Word. So when VFP goes to query that property again, Word is literally busy and/or doesn't have access to that property.

Get rid of the loop. You may possibly try your test to see if Word has been closed in the GotFocus of the Form it's launched from...on the idea that if they closed Word and switched back to the VFP app and the Form, GotFocus will fire.

>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)
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform