Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to wait till word finishes?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00724707
Message ID:
00725068
Vues:
24
Jose thanks for the reply.

If I place a wait window nowait after the Update it consistently works, otherwise Word throws an exception "The instruction at 0x.... referenced memory at 0x... The memory could not be read". Now as this is not a Fox error I didn't think I can trap it - is that correct?

>Hi Caroline
>
>If your Word operations are not that long, and you only need "a break" before going on, you may place something like this after the .Fields.Update()
>
>
>Declare Sleep in Win32Api long Delay
>
>For i=1 to 10
>	Sleep(100)  && miliseconds to wait
>	DOEVENTS    && process pending OS messages
>Next
>
>
>If you want to be on the safe side, you may additionaly place error trapping (using the ON ERROR command, or an Error method) on your next Word operation; the "on error" behavior would be to wait for an adicional interval before retrying.
>
>Hope this helps,
>Jose.
>
>>Hi all,
>>
>>Is there some way to check that Word has finished something before my code continues?
>>
>>The exact situation is that I am sometimes getting a crash with a "Server to Busy" error after I've got Word to perform a .Fields.Update(). When I suspend and step through the code I never get the error so I'm assuming that my code is trying to continue before the Update() has finished.
>>
>>Does anyone know of a way to trap for this?
>>
>>Thanks in anticipation.
Caroline
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform