返回一个 String 值,表明指定的打印机设备的名称。只读。
expression.DeviceName
expression 必需。返回“Applies To”列表中的一个对象的表达式。
下面的示例显示系统可用的所有打印机的信息。
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