LoginSignup
0
0

More than 5 years have passed since last update.

発掘 Printer オブジェクト (Publisher)

Posted at

Printer オブジェクト (Publisher)

プリンターオブジェクトは、コンピューターにインストールされているプリンターを表します。

注釈

Microsoft Publisher ユーザーのプリンターの設定] ダイアログ ボックス ([ファイル] メニュー) の設定に対応して用紙サイズ、 PaperSource、 PaperOrientation、プリンターオブジェクトなど、プロパティの多くインタ フェースです。
お使いのコンピューターにインストールされているすべてのプリンターのコレクションは、 InstalledPrintersコレクションによって表されます。

次の Microsoft Visual Basic for Applications (VBA) マクロは、コンピューターにインストールされているすべてのプリンターの一覧を取得、どちらかを決定する、プリンターオブジェクトのプロパティのPrinterNameとIsActivePrinterプロパティを使用する方法を示しています。それらは、現在作業中のプリンターといくつかのプリンターの設定を取得します。マクロには、イミディ エイトウィンドウに結果が表示されます。

Public Sub Printer_Example()

Dim pubInstalledPrinters As Publisher.InstalledPrinters
Dim pubApplication As Publisher.Application
Dim pubPrinter As Publisher.Printer

Set pubApplication = ThisDocument.Application
Set pubInstalledPrinters = pubApplication.InstalledPrinters

For Each pubPrinter In pubInstalledPrinters
Debug.Print pubPrinter.PrinterName
If pubPrinter.IsActivePrinter Then
Debug.Print "This is the active printer"
Debug.Print "Paper size is ", pubPrinter.PaperSize
Debug.Print "Paper orientation is ", pubPrinter.PaperOrientation
Debug.Print "Paper source is ", pubPrinter.PaperSource
End If
Next

End Sub

https://msdn.microsoft.com/ja-jp/VBA/Publisher-VBA/articles/printer-object-publisher
Application
DriverType
Index
IsActivePrinter
IsColor
IsDuplex
PaperHeight
PaperOrientation
用紙サイズ
PaperSource

Parent
PrintableRect
PrinterName
PrintMode

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0