Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On error resume next doesn't work
Message
From
29/08/2004 08:30:33
Hans-Otto Lochmann
Dr. Lochmann Consulting Gmbh
Frankfurt, Germany
 
 
To
All
General information
Forum:
Visual Basic
Category:
VBA
Title:
On error resume next doesn't work
Miscellaneous
Thread ID:
00937376
Message ID:
00937376
Views:
50
Hi,

I am working on an VBA module for Word 2000. When I assign a "wrong" printer name to
  Application.ActivePrinter = "\\Server\Wrong Printer Name on SomePort:"
I get the error message 5216 "Printer Error". So far so good. But the usual
  On Error GoTo 0
  On Error Resume Next
doesn't work here.I just want to intercept this message to ask the user to select another printer or to quit.

Any ideas ?

Background: This is a little macro allowing to print some documents on a printer, which the user can select. As this can be a "special printer", like Fax or PDF, it would be nice, if the macro could "remember" the selection, which the user had made earlier. When it starts the macro will save the present printer selection (i.e. a "normal" paper printer) and restore that setting, when it terminates. The above event might happen, if a printer is not available anymore, e.g it might have been uninstalled.

Hans
Reply
Map
View

Click here to load this message in the networking platform