返回或設(shè)置代表當(dāng)前系統(tǒng)上默認打印機的 Printer 對象??勺x寫。
expression 必需。返回“應(yīng)用于”列表中的一個對象的表達式。
下面的示例將 Printers 集合中的第一個打印機設(shè)為系統(tǒng)的默認打印機,然后報告其名稱、驅(qū)動程序信息以及端口信息。
Dim prtDefault As Printer
Set Application.Printer = Application.Printers(0)
Set prtDefault = Application.Printer
With prtDefault
MsgBox "Device name: " & .DeviceName & vbCr _
& "Driver name: " & .DriverName & vbCr _
& "Port: " & .Port
End With