Printer Dialog Box

  • Thread starter Todd Huttenstine
  • Start date
T

Todd Huttenstine

Hey

Using code, how would you make the printer dialog box come
up?

Also without showing the dialog box, is it possible to
list all the available printers?

Thank you
Todd Huttenstine
 
F

Frank Kabel

Hi Tom
seems your link is truncated :)
For the OP: Below a repost (I thinks it's from Tom and/or Jim Rech):
-----
http://support.microsoft.com/support/kb/articles/q166/0/08.asp
ACC: Enumerating Local and Network Printers

Enumerating Windows' Available Ports
http://www.mvps.org/vbnet/code/enums/enumports.htm
=======================

This macro enumerates printers and their connections. Parsing it you
may be
able to construct the syntax ActivePrinter wants:

Sub a()
Set WshNetwork = CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 To oPrinters.Count - 1 Step 2
Debug.Print "Port " & oPrinters.Item(i) & " = " & _
oPrinters.Item(i + 1)
Next
End Sub
 
B

Bob Phillips

Frank,

I think Tom was suggesting that the OP should use Google, and simply gave
him the groups search.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top