Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to wait till word finishes?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00724707
Message ID:
00725068
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform