Report. Printer 属性 (权限)Report.Printer property (Access)

返回或设置一个 Printer 对象,该对象表示当前系统上的默认打印机。Returns or sets a Printer object representing the default printer on the current system. 读/写。Read/write.



_表达式_一个代表**Report** 对象的变量。expression A variable that represents a Report object.


下面的示例将 Printers 集合中第一个打印机设置为系统的默认打印机,然后报告其名称、 驱动程序信息和端口信息。The following example makes the first printer in the Printers collection the default printer for the system, and then reports its name, driver information, and port information.

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 

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.