Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On error resume next doesn't work
Message
De
29/08/2004 08:30:33
Hans-Otto Lochmann
Dr. Lochmann Consulting Gmbh
Frankfurt, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
VBA
Titre:
On error resume next doesn't work
Divers
Thread ID:
00937376
Message ID:
00937376
Vues:
49
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
Répondre
Fil
Voir

Click here to load this message in the networking platform