Thread: Printer Names
View Single Post
 
Old 09-02-2019, 06:48 PM
Kenneth Hobson Kenneth Hobson is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Jun 2018
Posts: 37
Kenneth Hobson is on a distinguished road
Default

Code:
'http://www.vbaexpress.com/forum/showthread.php?64826-WSH-to-List-All-Printers
Sub M_snb_printers()
  MsgBox ActivePrinter

  With CreateObject("Wscript.network")
    For j = 0 To .EnumPrinterConnections.Count - 1 Step 2
      c00 = c00 & vbLf & .EnumPrinterConnections(j + 1) & " on " & .EnumPrinterConnections(j)
    Next
  End With
  
  MsgBox c00
End Sub
Reply With Quote