如题,并且,如何控制能够使用指定打印机打印?
望高手解答,在线等,急..

解决方案 »

  1.   

    Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, pPrinter As Any, ByVal cbBuf As Long, pcbNeeded As Long) As Long
      

  2.   

    设置打印机(ScriptedPrinter)为默认打印机
    引用wmi
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colInstalledPrinters =  objWMIService.ExecQuery _
        ("Select * from Win32_Printer Where Name = 'ScriptedPrinter'")
    For Each objPrinter in colInstalledPrinters
        objPrinter.SetDefaultPrinter()
    Next
      

  3.   

    http://vbnet.mvps.org/index.html?code/system/defaultprinter.htm觉得这个似乎更适合你