Printing Word document via automation

P

Patrick Spence

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?
 
P

Patrick Spence

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top