Link to home
Start Free TrialLog in
Avatar of detroitdr
detroitdr

asked on

Easily find an Access 2003 Paper Size Value for a Dymo Printer eg 20256 Shipping = 143 (on this machine)

I'm using Access 2003. I have different reports printing on different printers. One of those printers is a DYMO 400. I do not want to specify a printer for the report as this MDE will be going to many workstations and the printers could be on differnt ports etc. I have found the solution and now need to "automate it"
I use the follow to print to the printer currently:

set application.printer = application.printers("DYMO LableWriter 400")
stDocNam = "PrintLabel"
docmd.echo off
docmd.openreport stDocName, acViewPreview (yes i know i can ,, hidden)
with reports("PrintLabel).printer
.papersize = 143
.leftmargin = .233 * 1440
.itemsizeheight = 2.2083 x 1440
end with

OK so here is what I need to automate. ... I only found out that the Paper size for the DYMO Printer 400 is 143 because I had to make another report, choose specific printer...(Dymo 400)... select the label size (Shipping 20256)... then open the report, go to Alt-F11, CTRL-G and typed ?reports("printlabel").printer.papersize
This now gives me what THIS machine has for the Dymo 400 20256 Shipping address label .
I want to have some kind of a script that the user can run to automatically show ALL paper sizes (label sizes in this case for Dymo printers) AND THEIR corosponding ACCESS paper size single number... eg 143

This way I can then have a table and allow the user at that workstation to find the shipping lable single number and enter it thus allowing me to use in my code instead of hardcoding 143 which will change depending on each workstation.

help?

Thank-you in advance.
Avatar of stevbe
stevbe

this will entail api / registry as Access does not provide a way to iterate through paper sizes built in to it. I don't have the code and you might be better off asking in the VB TA.

Steve
I found the base api you could use ... PrtDevMode. I will say it is quite complex but Access Developers Handbook (desktop) noty only details it for you but also wraps it all up into a very user friendly class module.

Steve
here are a couple of good links here on EE, the second one has a function someone put together that handles papersize using PrtDevMode

https://www.experts-exchange.com/questions/20107944/not-understanding-prtdevmode-example.html
https://www.experts-exchange.com/questions/10218479/selecting-page-size-in-code.html
Avatar of detroitdr

ASKER

I did see the PrtDevMode, but those commands do not work with MDE, only MDB.
I just can not believe that you can not get VB to search some file (Access must setup?) for printer and labels for the number it assigns to each "paper size" that printer supports....

Thank-you for your answers

(I'm new here so I'm not sure if I'm to close this report done or not.... I only see Accept as solution or multiple... and i have no idea what I should do for this board...)

I'll try asking in VB as per your suggestion. thx


ASKER CERTIFIED SOLUTION
Avatar of stevbe
stevbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've asked this question in another area.

To all who stumble across this issue.... It currently appears that:

-you have a Report in Access
-you are making a MDE
-you are not selecting a specific printer (for obvious reasons regarding deployment)
-you are using non standard paper (Dymo labels are SMALL)
-you can not automatically query Access to find out the paper size Number assigned
   to an installed printer for that printers paper. (eg Dymo Shipping label paper 30256)
-you CAN do it yourself manually.. but that defeats the purpose.

You can do it manually by using the MDB, copy the report, select the specific printer in page setup, select the paper size (what label you want...30256 Shipping when using Dymo printer), then open the report, press Alt-F11, Ctrl-G, and type ?reports("your report name").printer.papersize
this will tell you for this computer (with its own installed printers) what number Access assigned to that "paper size" (label)

That is what I want to do automatically as the order of installed printers and what printers installed will change that value from system to system..... and in my opinion.. if you can't select non-standard paper sizes (2.23" x 4" Dymo shipping labels) then giving us commands to change margins,row spacing,item size height and width,orientation and itemlayout is useless. (Again because it appears you can't do the manual query above to find out the unique number on a workstation for the lable as the pre-defined papersizes don't cover Custom.....

Should I close this or does anyone know if you can do that manual query automatically?