I am going to use the following bit of code to set the default printer for my app.
VB Code:
  1. Dim X as Printer
  2.  
  3. For Each X In Printers
  4.     If X.DeviceName = "MyPrinter" Then
  5.         Set Printer = X
  6.         Exit For
  7.     End If
  8. Next X
  9.  
  10. If X.DeviceName <> "MyPrinter" Then
  11.      MsgBox "MyPrinter is not installed!"
  12.      Exit Sub
  13. End If
Before I do though, does anyone know if there is any possibility for this to fail (excluding of course, the absence of MyPrinter on the system). In other words, does anyone believe that this is not a fool-proof way of setting the default printer for an app?

If you know of any issues, please let me know.