一个很简单的方法:
 dim lWidth as long
  lwidth=printer.width
  如果出错那么系统中没有打印机.

解决方案 »

  1.   

    通过检查 Printer.DeviceName 的值可以得到打印机设备名,别忘了给我加分,:-)
      

  2.   

    Option Explicit
    Public Function DoesPrinterExist() As Boolean    On Error GoTo HandleError
        
            Dim o_prnItem As Printer
            Dim o_blnRet As Boolean
            
            o_blnRet = False
            
            For Each o_prnItem In Printers
                If Not (o_prnItem.DeviceName Like "%传真%") Then
                    o_blnRet = True
                    Exit For
                Else
                End If
            Next
            
            DoesPrinterExist = o_blnRet
            
        Exit Function
        
    HandleError:
        DoesPrinterExist = False
            
    End Function
    Private Sub Command1_Click()
            
        MsgBox DoesPrinterExist()
            
    End Sub