>> Printer Port list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I want to list the printers and their ports using the following...


If printerList.Count > 0 Then
For Each ptr In printerList
ptrName = ptr.DeviceName
ptrPort = ptr.Port

spBarCodePrinter = spBarCodePrinter & """" & ptrName & """;" &
"""" & ptrPort & """;"
DoEvents
Next ptr
End If

The above code loops each printer to build a list of printer names and
ports. Unfortunitely the list shows the same printer port for all printes
(which is not the case).

Why is it that each printer is correctly listed and not each printer's port?

Any ideas or suggestions to build a correct list is appreciated :-)

Many thanks
Jonathan
 
Jonathan said:
Hi, I want to list the printers and their ports using the following...


If printerList.Count > 0 Then
For Each ptr In printerList
ptrName = ptr.DeviceName
ptrPort = ptr.Port

spBarCodePrinter = spBarCodePrinter & """" & ptrName &
""";" & """" & ptrPort & """;"
DoEvents
Next ptr
End If

The above code loops each printer to build a list of printer names and
ports. Unfortunitely the list shows the same printer port for all
printes (which is not the case).

Why is it that each printer is correctly listed and not each
printer's port?

Any ideas or suggestions to build a correct list is appreciated :-)

I gather that this is a known bug. You may need to call Windows API
functions to get a proper list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top