Re: Printing Word document via automation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Patrick Spence (patrick_at_pkspence.com)
Date: 02/25/04


Date: Wed, 25 Feb 2004 00:46:47 -0500

I fixed the problem by using the Sleep function in Kernel.32. By placing a
"sleep 1000" immediately after .PrintOut(), the documents appear to be
printing ok. 'Seems almost like a race condition was the culprit. I'll know
more after some additional testing.

"Patrick Spence" <patrick@NOSPAM.pkspence.com> wrote in message
news:%23Px497w%23DHA.1796@TK2MSFTNGP12.phx.gbl...
> When I attempt to print a Word document using automation, the document
will
> not print. I'm "talking" to Word via a DLL written in VB6. The document is
> getting saved, also being done in the DLL. What's really wierd is that if
I
> step thru the DLL code using the debugger, as soon as .PrintOut method for
> the document gets called, it prints. However, running thru the code w/o
the
> debugger, nothing happens. I've added a few DoEvents to give up some CPU
> time, but this hasn't done any good.
>
> I'm running XP Pro, Office 2000.
>
> Ideas anyone?
>
>
>



Relevant Pages

  • Re: Problem only in release build - help!!
    ... could debug outside of the debugger. ... without the Sleep function call - presumably the debugger is doing ... The Wait will yield the CPU until the event is signalled and not waste CPU ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Problem only in release build - help!!
    ... could debug outside of the debugger. ... waiting for the Transform function to set the FrameReady flag like this: ... without the Sleep function call - presumably the debugger is doing ...
    (microsoft.public.win32.programmer.directx.video)