Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing through a print server

Status
Not open for further replies.

kiwiCoder

Technical User
Aug 2, 2001
45
0
0
NZ
Hi there, we have used PPLB to create txt files and send to a printer via parallel port but now the printers are attached via a print server and I cannot use the same VB6 code to send the text file. Has anyone done this or have any ideas. For some reason the port is seen as Ne00: instead of the actual port name IP_192.168.1.9

Cheers

If you love your job you never have to work again.
 
If you can see the printer, this will let you select it.
It highlights the default printer first, and when you click it sets it while the app is running. You can save it to a file, and set it when the app starts.

Code:
Option Explicit

Private Sub Combo1_Click()
  Dim p As String
  Dim prt As Printer
  p = Combo1.List(Combo1.ListIndex)
  For Each prt In Printers
    If prt.DeviceName = p Then
    Set Printer = prt
    End If
  Next prt
End Sub

Private Sub Form_Load()
  Dim x%
  Dim prt As Printer
  Combo1.Clear
  For Each prt In Printers
    Combo1.AddItem prt.DeviceName
  Next prt
  For x = 0 To Combo1.ListCount
      If Combo1.List(x) = Printer.DeviceName Then
      Combo1.TopIndex = x
      Combo1.ListIndex = x
      Exit Sub
    End If
  Next x
End Sub

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top