Thread: Printers
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Printers

Hi Jason,

Try:
'==========
Private Sub UserForm_Activate()
ListPrinters
End Sub
'<<==========


'==========
Sub ListPrinters()
Dim wshNetwork As Object
Dim oDrives As Object
Dim oPrinters As Object
Dim iCount As Integer
Dim sCurrentprinter As String
sCurrentprinter = Application.ActivePrinter
Set wshNetwork = CreateObject("WScript.Network")
Set oDrives = wshNetwork.EnumNetworkDrives
Set oPrinters = wshNetwork.EnumPrinterConnections
For iCount = 0 To oPrinters.Count - 1 Step 2
ComboBox1.AddItem oPrinters.Item(iCount + 1)
Next
End Sub

'<<==========


---
Regards,
Norman



"Jason Zischke" wrote in message
...
Is there a way for VB Excel to list all the avalable printers on your
computer in a ComboBox.