Word) (Application.ActivePrinter 屬性

會傳回或設定使用中印表機的名稱。 讀取/寫入的 String

語法

運算式ActivePrinter

expression 代表 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:"

另請參閱

Application 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應