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
Jonathan West - 30 Oct 2006 14:31 GMT
> When printing a word document through ole automation, I get a problem when
> a user can't access the printer.
[quoted text clipped - 3 lines]
> 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

Signature
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