Form.PrtDevNames プロパティ (Access)

フォームまたはレポートの [印刷] ダイアログ ボックスで選択したプリンターに関する情報を設定または返すには、PrtDevNames プロパティを使用します。 値の取得と設定が可能なバリアント型 (Variant) の値です。

構文

PrtDevNames

expressionForm オブジェクトを表す変数です。

注釈

PrtDevModePrtDevNames、および PrtMip プロパティに関する完全なドキュメントについては、Win32 ソフトウェア開発キットを参照することを強くお勧めします。

PrtDevNames プロパティは、Win32 Software Development Kit で定義されている DEVNAMES 構造体を複製する可変長の構造体です。

PrtDevNames プロパティのメンバーは次のとおりです。

メンバー 説明
DriverOffset Specifies the offset from the beginning of the structure to a Null- terminated string that specifies the file name (without an extension) of the device driver. This string is used to specify which printer is initially displayed in the Print dialog box.
DeviceOffset 構造体の先頭から、装置の名前を指定する Null 終端文字列までのオフセットを示します。 この文字列は、null 文字も含めて 32 バイト以内とし、DEVMODE 構造体の DeviceName メンバーと同じ文字列にする必要があります。
OutputOffset 構造体の先頭から、物理的な出力媒体 (出力ポート) を表す MS-DOS の装置名を指定する Null 終端文字列までのオフセットを示します。たとえば、"LPT1:" があります。
Default Specifies whether the strings specified in the DEVNAMES structure identify the default printer. Before the Print dialog box is displayed, if Default is set to 1 and all of the values in the DEVNAMES structure match the current default printer, the selected printer is set to the default printer. Default is set to 1 if the current default printer has been selected.

PrtDevNames プロパティを設定するには、[ 印刷 ] ダイアログ ボックスの [プリンターの設定] でプリンターを選択します。 プロパティは、Visual Basic を使用して設定することもできます。

Access では、DEVNAMES 構造体を使用して [ 印刷 ] ダイアログ ボックスを初期化します。 ユーザーが [ OK ] をクリックしてダイアログ ボックスを閉じると、選択されたプリンターに関する情報が PrtDevNames プロパティに設定されます。

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

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