vb中如何获取系统默认打印机的名称?
3个回答
展开全部
添加一个CommonDialog控件,CommonDialog1
添加一个按钮
代码如下:
Option Explicit
Private Sub Command1_Click()
CommonDialog1.Flags = cdlPDAllPages Or cdlPDPageNums Or cdlPDSelection Or cdlPDCollate Or cdlPDPrintSetup
CommonDialog1.ShowPrinter
End Sub
运行后,单击按钮,看看!
添加一个按钮
代码如下:
Option Explicit
Private Sub Command1_Click()
CommonDialog1.Flags = cdlPDAllPages Or cdlPDPageNums Or cdlPDSelection Or cdlPDCollate Or cdlPDPrintSetup
CommonDialog1.ShowPrinter
End Sub
运行后,单击按钮,看看!
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Dim prn As Printer
Me.AutoRedraw = True
Me.Cls
Print "开始"
Print ""
For Each prn In Printers
Print prn.DeviceName
If prn.Orientation Then
Print "默认打印机名称 " & prn.DeviceName
End If
Next
Print ""
Print "完毕"
End Sub
Dim prn As Printer
Me.AutoRedraw = True
Me.Cls
Print "开始"
Print ""
For Each prn In Printers
Print prn.DeviceName
If prn.Orientation Then
Print "默认打印机名称 " & prn.DeviceName
End If
Next
Print ""
Print "完毕"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询