Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

How to determine when Word has completed printing?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WayneM - 10 Mar 2005 17:53 GMT
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
Jay Freedman - 10 Mar 2005 18:59 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.