返回代表當(dāng)前系統(tǒng)上所有可用打印機(jī)的 Printers 集合。
expression 必需。返回“應(yīng)用于”列表中的一個對象的表達(dá)式。
下面的示例顯示在當(dāng)前系統(tǒng)上所有可用打印機(jī)的有關(guān)信息。
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