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
> 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.
[quoted text clipped - 3 lines]
>
> 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

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
WayneM - 11 Mar 2005 04:57 GMT
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
> > 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.
[quoted text clipped - 14 lines]
> oWord.Quit
> oWord = Nothing