How to determine when Word has completed printing?

W

WayneM

I am using VB6 to control Word to create and print a document. After
printing I am quitting Word, but itr seems Word is still printing. How can I
pause or wait until word is completed printing?

Thanks in advance,

WayneM
 
J

Jay Freedman

WayneM said:
I am using VB6 to control Word to create and print a document. After
printing I am quitting Word, but itr seems Word is still printing.
How can I pause or wait until word is completed printing?

Thanks in advance,

WayneM

The document object's PrintOut method takes a bunch of optional arguments.
The first one is a Boolean named Background. If you set it to False, the
PrintOut method won't return until Word has finished handing off to the
spooler. So try this in your VB6 code:

oWordDoc.PrintOut(False)
oWordDoc.Close(0) ' do not save
oWordDoc = Nothing
oWord.Quit
oWord = Nothing
 
W

WayneM

Jay,

Thanks for the suggestion, but I did try that. I thought aobut it and I
realized I did not accruately describe my problem. I am using a very old
printer that uses a serial port. I can print from Notepad out of this port,
manually, but I need to do this programatically. I am thinking the problem
is that the driver cannot return information back to Word. It is just a
simple ack/nak type of handshake, using the standard Window Generic Text
driver.

I suppose the only thing I can do is just insert some wait loops until the
printing is done. Is this the right tact or is there something else I can do?

Thanks in advance,

WayneM
 

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