------------------------------------------------------------
Dim P As Printer, OldP As Printer
OldP = Printer
For Each P In Printers
If P.DeviceName = [the one you want] Then
Set Printer = P
Exit For
End If
Next
'do your printing here
Set Printer = OldP
------------------------------------------------------------
It actuallly not neccesary to change back to the old printer because as soon at the program end this is done automatically.
If you want to do it anyway:
-----------------------------------------------------------
Dim P As Printer, OldP as string
OldP = Printer.DeviceName
For Each P In Printers
If P.DeviceName = "\\HOEK\castle" Then
Set Printer = P
Exit For
End If
Next
'do your printing here
For Each P In Printers
If P.DeviceName = OldP Then
Set Printer = P
Exit For
End If
Next
-----------------------------------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.