ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing Word doc from Excel (https://www.excelbanter.com/excel-programming/279754-printing-word-doc-excel.html)

Ed Stevens[_2_]

Printing Word doc from Excel
 
Ok, by searching the archives and asking for direct help, I have my
Excel macro opening, writing to, printing, and closing a Word doc.
Only two things left.

Given this snip of code:


WdApp.ActiveDocument.PrintOut
WdApp.ActiveDocument.Close savechanges:=False
WdApp.Quit
Set WdApp = Nothing

The doc is printing, but the .Quit results in a pop-up that a print is
in progress, do I really want to quit. Is there an intelligent way to
check the status of the print before issuing the .Close? It's a
short, one-page doc, so I could just put a delaying loop in, but I'd
rather be smarter about it.

Also, instead of blindly printing to the default printer, I'd like to
pop up a list box to allow the user to select which printer.

All assistance appreciated.


Ed Stevens[_2_]

Printing Word doc from Excel
 
Looks like mvps.org will be a most useful site! I'm seeing answers to
other questions that I would have ended up asking -- I just didn't
know it yet! Thanks.


On Thu, 16 Oct 2003 19:07:16 -0400, Debra Dalgleish
wrote:

There's some information here on checking the print status:

http://www.mvps.org/word/FAQs/Macros...itForPrint.htm

For a list of printers:

http://www.mvps.org/word/FAQs/Macros...lePrinters.htm

Ed Stevens wrote:
Ok, by searching the archives and asking for direct help, I have my
Excel macro opening, writing to, printing, and closing a Word doc.
Only two things left.

Given this snip of code:


WdApp.ActiveDocument.PrintOut
WdApp.ActiveDocument.Close savechanges:=False
WdApp.Quit
Set WdApp = Nothing

The doc is printing, but the .Quit results in a pop-up that a print is
in progress, do I really want to quit. Is there an intelligent way to
check the status of the print before issuing the .Close? It's a
short, one-page doc, so I could just put a delaying loop in, but I'd
rather be smarter about it.

Also, instead of blindly printing to the default printer, I'd like to
pop up a list box to allow the user to select which printer.

All assistance appreciated.




All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com