Gustav Brock
Gustav at cactus.dk
Wed Feb 9 02:22:26 CST 2005
Hi Steve Are the media/paper numbers real or hidden? If I look up the data for PrintMediaReady it contains not a number but a string with the actual name of the media, like Letter or A4. /gustav >>> Developer at UltraDNT.com 08-02-2005 18:13:13 >>> Right. Lets say invoice paper internally is 123 on your pc, but 149 on the user's. When you set yours, the application can't find the match at the user, so the user's pc sets it to 1 (letter). You can write the correct value to registry, or, I imagine get the right number out of the registry and just use that in the PRTDEVMODE API - but I havent used that API in years, I don't remember all the intricacies of it (Its much easier in Access XP+, with the Printer object). It could eventually fail though, because the value only lasts until the user deletes the printer, or deletes the custom paper. If they do that, you have to dig around for it again. Steve -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, February 08, 2005 11:40 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] A97. Report with printerandpaperselectionpickswrongpaper when deployed on identica Hi Steve That sounds close. So what you are saying is, that PrintMediaReady at the client initially contains another media (paper format) than the one we wish to use? And - if once corrected, manually or by writing the registry - it will not fail later? /gustav >>> Developer at UltraDNT.com 08-02-2005 17:15:38 >>> The issue is in the way 2000/XP handles Custom paper. In Me/98, you only had one custom paper size per machine, represented by the constant 255. In 2000/XP, there is support for multiple custom paper sizes, therefore, it is some random number that Windows gives the custom paper sizes, that can differ from PC to PC, even with apparently identical setups. On your PC you are assigning a paper-size number that the client doesn't have, as the default paper, when you set your paper to Invoice. The client PC defaults to letter because it can't find the same paper size number as on your PC. You have to dig in Registry, under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\<<printer name>>\DsDriver The PrintMediaSupported key has multiple values. Find Invoice, then use that as the value for PrintMediaReady. Or - do what I did - give the user a "Setup" screen. Steve