WPS 基础接口 > 文字 API 参考 > Application > 属性 > Application.ActivePrinter 属性
返回或设置活动打印机名称。可读/写 String 类型。

语法

表达式.ActivePrinter

表达式   一个代表 Application 对象的变量。

说明

使用 ActivePrinter 属性设置打印机会更改默认打印机。有关详细信息,请参阅 设置 ActivePrinter 会更改系统默认打印机。

示例

本示例显示当前打印机的名称。

示例代码
MsgBox( "The name of the active printer is " + ActivePrinter)

本示例将网络 HP LaserJet IIISi 打印机设置为活动打印机。

示例代码
Application.ActivePrinter = "HP LaserJet IIISi on \\printers\laser"

本示例将 LPT1 端口的本地 HP LaserJet 4 打印机设置为活动打印机。

示例代码
Application.ActivePrinter = "HP LaserJet 4 local on LPT1:"


请参阅