At work I am creating a database and reports that will be used by multiple people. What I need is for my reports to print to a specific colour printer and be manual feed as the papersize is different.
The following coding does select the printer that I require on my computer, but as different people have different printers loaded to their machines the number of printers and the orders vary, so my coding falls down as the particular printer I am requiring is a different number on other computers.
Expand|Select|Wrap|Line Numbers
- Sub SelectPrinter()
- Dim Prn As Printer
- Dim Names() As String
- Dim I As Integer
- ReDim Names(Application.Printers.Count - 1)
- For I = 0 To Application.Printers.Count - 1
- Names(I) = Application.Printers(I).DeviceName
- Debug.Print Application.Printers(I).DeviceName
- Next
- Set Application.Printer = Application.Printers(1)
- End Sub
Thank you for your help
AK