PDA

Click to See Complete Forum and Search --> : Default printer number


willye
Nov 24th, 1999, 08:01 PM
How can I know the number of the default printer in the collection of printers? Not the devicename but the number. Thanks!!

Aaron Young
Nov 25th, 1999, 12:32 PM
You could enumerate all the Printers until you find the Default, eg.

Private Sub Command1_Click()
Dim I As Integer
For I = 0 To Printers.Count - 1
If Printers(I).DeviceName = Printer.DeviceName Then Exit For
Next
MsgBox "Printer No." & I & " - " & Printer.DeviceName & vbCrLf & "Is the Default Printer"
End Sub



------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net