Printer オブジェクト (Publisher)

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

注釈

PaperSizePaperSourcePaperOrientation などの Printer オブジェクトのプロパティの多くは、Microsoft Publisher ユーザー インターフェイスの [印刷設定] ダイアログ ボックス ([ファイル] メニュー) の設定に対応しています。

お使いのコンピューターにインストールされているすべてのプリンターのコレクションは、 InstalledPrinters コレクションによって表されます。

PrinterName を使用する方法を次の Microsoft Visual Basic for Applications (VBA) マクロが表示し、 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

プロパティ

関連項目

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。