Results 1 to 2 of 2

Thread: Default printer number

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    14

    Post

    How can I know the number of the default printer in the collection of printers? Not the devicename but the number. Thanks!!

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You could enumerate all the Printers until you find the Default, eg.
    Code:
    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
    [email protected]
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width