Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

適用對象

應用程式物件

Form 物件

Report 物件

傳回或設定代表目前系統上預設印表機的 Printer 物件。 讀/寫。

expression.Printer

運算式 必要。 傳回 [套用至] 清單中其中一個對象的表達式。

範例

以下範例將 Printers 物件集合中的第一個印表機設定為系統的預設印表機,然後報告其名稱、驅動程式資訊和連接埠資訊。

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

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×