Hello cuewoz,
This macro should provide a good starting point. It lists the available printers as you describe, but this code is for computers that use NTFS (Windows NT File Structure). You don't mention which operating system you are using either in your post in your profile. If you are using Windows 2000 or later then this macro should run.
'Written: April 15 ,2009
'Author: Leith Ross
'Summary: Lists the printers and ports that are available to the user.
Sub PrintersAndPorts()
'This works with Windows 2000 and up
Dim Arr As Variant
Dim Device As Variant
Dim Devices As Variant
Dim Msg As String
Dim RegObj As Object
Dim RegValue As String
Const HKEY_CURRENT_USER = &H80000001
Set RegObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
RegObj.enumvalues HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\Devices", Devices, Arr
For Each Device In Devices
RegObj.getstringvalue HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\Devices", Device, RegValue
Msg = Msg & Device & " on " & Split(RegValue, ",")(1) & vbCrLf
Next
MsgBox Msg, vbInformation, "Printers and Ports"
End Sub
Bookmarks