Printers 属性

       

返回代表当前系统上所有可用打印机的 Printers 集合。

expression.Printers

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