Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WORD automation and busy signals
Message
De
12/01/2001 19:06:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
WORD automation and busy signals
Divers
Thread ID:
00463296
Message ID:
00463296
Vues:
88
>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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform