Form.PrtDevNames 属性 (Access)

使用 PrtDevNames 属性可以设置或返回有关在窗体或报表的“ 打印 ”对话框中选择的打印机的信息。 读/写 Variant

语法

表达式PrtDevNames

expression:表示 Form 对象的变量。

备注

强烈建议参阅 Win32 软件开发工具包,获取有关 PrtDevModePrtDevNamesPrtMip 属性的完整文档。

PrtDevNames 属性是镜像定义 Win32 软件开发工具包中的 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 终结的字符串间的偏移量,该字符串指定的是设备的名称。 此字符串的长度不能超过 32 个字节(包括空字符),并且必须与 DEVMODE 结构的 DeviceName 成员完全相同。
OutputOffset 指定从结构开始处到以 Null 终结的字符串间的偏移量,该字符串指定的是物理输出介质(输出端口)的 MS-DOS 设备名称,例如"LPT1:"。
Default Specifies whether the strings specified in the DEVNAMES structure identify the default printer. 在“打印”对话框显示之前,如果 Default 设置为 1,并且 DEVNAMES 结构中所有的值都与当前的默认打印机匹配,所选打印机即设置为默认打印机。 Default is set to 1 if the current default printer has been selected.

当您在 打印 对话框中的打印机部分中进行选择时,Microsoft Access 设置 PrtDevNames 属性。 还可以使用 Visual Basic 设置 属性。

Access 使用 DEVNAMES 结构初始化“ 打印 ”对话框。 当用户选择 确定 以关闭该对话框时,通过 PrtDevNames 属性返回关于所选打印机的信息。

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。