Microsoft Office Forums Printer Names

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2019, 03:13 PM
hickeyt hickeyt is offline Printer Names Windows 10 Printer Names Office 2007
Novice
Printer Names
 
Join Date: Apr 2019
Posts: 6
hickeyt is on a distinguished road
Default Printer Names


Is there a way in VBA to loop through and return the full names of available printers? I want to have a table of printers but have VBA be able to loop through the full name list to determine the correct port.
For example, I have a printer "Canon ip7200 series" but I want VBA to be able to find that it is "Canon iP7200 series on Ne08:"
Thank you.
Reply With Quote
  #2  
Old 09-02-2019, 06:48 PM
Kenneth Hobson Kenneth Hobson is offline Printer Names Windows 10 Printer Names 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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printer Listing hickeyt Excel Programming 4 04-30-2019 08:44 AM
Printer Problems-Need to reload printer each day jekronenfeld Windows 1 11-24-2014 12:35 AM
How to enter names in Resource Pool/names pstein Project 1 03-26-2012 07:37 AM
MS Word 2003, printer queue in 'printer properties' shows 1 job; no job in printer benhuxham Word 0 07-25-2011 06:58 PM
Printer Names 2 printer icons Topazdan Office 3 05-18-2010 01:35 AM


All times are GMT -7. The time now is 10:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft