Microsoft KB Archive/109402

{|
 * width="100%"|

ACC1x: How to Use the PrtDevNames Property on Reports

 * }

Q109402

-

The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1
 * Microsoft Access Distribution Kit, version 1.1

-

SUMMARY
You can use the PrtDevNames property to check or change the currently connected printing device and port for specific reports.

The PrtDevNames property is not documented in the Microsoft Access manuals, but are planned for inclusion in a future release of the program.

MORE INFORMATION
The PrtDevNames property sets or returns information about the selected printer. It is a variable-length string that mirrors the DEVNAMES structure defined in the Microsoft Windows Software Development Kit, with the following components:


 * DriverOffset: Specifies the offset from the beginning of the structure to a null-terminated string that specifies the filename (without an extension) of the device driver. This string is used to set which printer is initially displayed in the dialog box.
 * DeviceOffset: Specifies the offset from the beginning of the structure to the null-terminated string that specifies the name of the device. This string cannot exceed 32 bytes in length, including the null character, and must be identical to the DeviceName member of the DEVMODE structure. You can determine the driver name and device name by looking at the [DEVICES] section of the WIN.INI file.
 * OutputOffset: Specifies the offset from the beginning of the structure to the null-terminated string that specifies the MS-DOS device name for the physical output medium (the output port), for example, "LPT1:".
 * Default: Specifies whether the strings specified in the DEVNAMES structure identify the default printer. On input, if Default is set to 1 and all of the values in the DEVNAMES structure match the current default printer, the selected printer will be set to the default printer. On output, Default is set to 1 if the current default printer has been selected.

Microsoft Access uses the DEVNAMES structure to initialize the Print Setup dialog box. When you choose the OK button to close the dialog box, information about the selected printer is returned in the PrtDevNames property.

NOTE: You cannot change the PrtDevNames setting without changing the PrtDevMode setting to your current printer settings. Some Windows printer drivers assume that the PrtDevMode was created by that driver. If you select a different printer driver in the PrtDevNames structure without changing the PrtDevMode structure, Microsoft Access will pass the old PrtDevMode structure to the new printer driver. This may cause the printer driver to operate incorrectly and could cause Application Errors.

Additional query words: PtrIss

Keywords : kbprint

Issue type : kbhowto

Technology :