Hi
Someone wrote the macro below to show all printers that a user is connected to. I modified it so that it shows the info in an excel sheet.
IT shows the printer name.
What would I need to change in the Macro to list all Printers on a particular Windows network, whether I am connected to them or not?
Sub PrintersOnNetwork()
'Check which Printers u r connected to, msgbox
Set WshNetwork = CreateObject("WScript.Network")
Set objPrinters = WshNetwork.EnumPrinterConnections
PrinterStr = "Printers:" & Chr(13)
For i = 0 To objPrinters.Count - 1 Step 2
PrinterStr = PrinterStr & "Printer " & objPrinters.Item(i) & " = " & objPrinters.Item(i + 1) & Chr(13)
Sheets("PrinterList").Activate
Cells(i + 1, 1).Value = "Printer " & objPrinters.Item(i) & " = " & objPrinters.Item(i + 1) & Chr(13)
Next
Columns(1).AutoFit
End Sub
Someone wrote the macro below to show all printers that a user is connected to. I modified it so that it shows the info in an excel sheet.
IT shows the printer name.
What would I need to change in the Macro to list all Printers on a particular Windows network, whether I am connected to them or not?
Sub PrintersOnNetwork()
'Check which Printers u r connected to, msgbox
Set WshNetwork = CreateObject("WScript.Network")
Set objPrinters = WshNetwork.EnumPrinterConnections
PrinterStr = "Printers:" & Chr(13)
For i = 0 To objPrinters.Count - 1 Step 2
PrinterStr = PrinterStr & "Printer " & objPrinters.Item(i) & " = " & objPrinters.Item(i + 1) & Chr(13)
Sheets("PrinterList").Activate
Cells(i + 1, 1).Value = "Printer " & objPrinters.Item(i) & " = " & objPrinters.Item(i + 1) & Chr(13)
Next
Columns(1).AutoFit
End Sub