Word automation print, hide error messages

J

Jonas Pedersen

When printing a word document through ole automation, I get a problem when a
user can't access the printer.
My aaplication uses the document.PrintOut method.
I have tried to set application.DisplayAlerts = FALSE, but the error message
still occurs, and the word application becomes visible.
What I would like was just the printout method to return FALSE and continue
my application.

Please help

Jonas
 
J

Jonathan West

Jonas Pedersen said:
When printing a word document through ole automation, I get a problem when
a user can't access the printer.
My aaplication uses the document.PrintOut method.
I have tried to set application.DisplayAlerts = FALSE, but the error
message still occurs, and the word application becomes visible.
What I would like was just the printout method to return FALSE and
continue my application.


Hi Jonas

You can use this code to see which printers are available

Getting names of available printers
http://www.word.mvps.org/FAQs/MacrosVBA/AvailablePrinters.htm

Set the ActivePrinter to one of those, and you should normally be OK


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
Top