Access) (Printer.DeviceName 属性

返回指示指定打印机设备名称的 字符串 。 此为只读属性。

语法

表达式DeviceName

表达式 表示 打印机 对象的变量。

示例

下面的示例显示有关系统中所有可用打印机的信息。

Dim prtLoop As Printer 
 
For Each prtLoop In Application.Printers 
 With prtLoop 
 MsgBox "Device name: " & .DeviceName & vbCr _ 
 & "Driver name: " & .DriverName & vbCr _ 
 & "Port: " & .Port 
 End With 
Next prtLoop 
 

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。