从Excel,Outlook等打印时,有3台打印机显示。 当我调用PrintDialog1.ShowDialog()时,它只显示默认打印机。 如何显示所有可用的打印机? 谢谢
答案 0 :(得分:0)
这应该会为您提供已安装打印机的列表,如果它们没有显示此代码,您可能需要更新驱动程序?
Dim controller As New ServiceController("Spooler")
If controller.Status = ServiceControllerStatus.Running Then
'http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/fe615570-ce3e-419b-86fc-7f98aed71c8f
For Each currentPrinter As String In System.Drawing.Printing.PrinterSettings.InstalledPrinters
'now add the currentPrinter to a list ...
Next
End If