Lothar Haensler
February 9th, 2000, 08:46 AM
In my Word macro I save a file in RTF format by using the FileSaveAs statement in Wordbasic.
After that I want to inform my VB app via BroadcastSystemMessage.
This works most of the time.
But sometimes, when the VB app tries to access the RTF file, it is not there yet.
Only when the VB app waits for a few milliseconds can it safely acccess the RTF file.
It seems as if the FileSaveAs routine returns before the file has been completely written.
I have a theory that FileSaveAs runs in a separate thread. (OTOH, most theories that make sense
turned out to be wrong :-)
Has anyone ever experienced that behavior in Word2000 and VB 6?
any suggestions for workarounds ("waiting" sucks!)?
For reasons I can't explain here, we can't use COM...
After that I want to inform my VB app via BroadcastSystemMessage.
This works most of the time.
But sometimes, when the VB app tries to access the RTF file, it is not there yet.
Only when the VB app waits for a few milliseconds can it safely acccess the RTF file.
It seems as if the FileSaveAs routine returns before the file has been completely written.
I have a theory that FileSaveAs runs in a separate thread. (OTOH, most theories that make sense
turned out to be wrong :-)
Has anyone ever experienced that behavior in Word2000 and VB 6?
any suggestions for workarounds ("waiting" sucks!)?
For reasons I can't explain here, we can't use COM...