I hate to bring this to the front again, but here goes.
I tested stongm's method on my PC, which only has one port, built in. It works great.
I have a friend halfway around the world to test it for me.
He said his PC doesnt have a built in port, but he added a PCI card with address of H9F00.
He said the code is not working for him.
It works on his wife's PC, which has a built in port, but not his add-on card.
Heres strongm's code, with my revisions:
Private Sub Command1_Click()
'this lists available printer port addies
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ParallelPort")
For Each objItem In colItems
Debug.Print objItem.Name
Set colPNP = objWMIService.ExecQuery("SELECT * FROM Win32_PNPAllocatedResource")
For Each lptport In colPNP
If InStr(Replace(lptport.dependent, "\\", "\"), objItem.PNPDeviceID) > 0 Then
'Debug.Print lptport.antecedent
For x = (Len(lptport.antecedent) - 1) To 1 Step -1
If Mid(lptport.antecedent, x, 1) = Chr(34) Then Exit For
Next x
List1.AddItem Val(Mid(lptport.antecedent, x + 1))
End If
Next
Next
End Sub
Does anyone have an addon card they can test this with?