如何判断机器上是否安装有打印机?(在线等候) 一个很简单的方法: dim lWidth as long lwidth=printer.width 如果出错那么系统中没有打印机. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 通过检查 Printer.DeviceName 的值可以得到打印机设备名,别忘了给我加分,:-) Option ExplicitPublic 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 FunctionPrivate Sub Command1_Click() MsgBox DoesPrinterExist() End Sub label..Caption的问题 从excel中复制图片到word中(使用vb程序实现) 求助关于ActiveReport的列值合计! 点击控件次数 我的同事和我說: csdn論壇太差勁了!!! API关于控制别的程序窗体问题 Form上放了很多控件,但Form放大后,控件仍旧那么大,咋设置和Form大小同步?好像.net里有Dock的。 怎么调用sqlserver DTS服务向导生成的VB的.bas模块文件 象line画线一样,但要求画出的线是管状的,应当怎样实现? 请问清理硬盘里的垃圾文件该怎么做? 2个简单的VB问题,分别给分 求高斯算法程式!!急(50分求)
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