Solved

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

Posted on 2007-03-28
6
381 Views
Last Modified: 2013-11-28
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.
0
Comment
Question by:detroitdr
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
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
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
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
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
here are a couple of good links here on EE, the second one has a function someone put together that handles papersize using PrtDevMode

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20107944.html
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_10218479.html
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:detroitdr
Comment Utility
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


0
 
LVL 39

Accepted Solution

by:
stevbe earned 500 total points
Comment Utility
VB has a different printer object that you can not use in Access but it basically exposes the same properties as PrtDevMode and when they move beyond the built-in capabilities they use PrtDevMode.

Here are the guidlines for how to close questions.
http://www.experts-exchange.com/help.jsp#hs5
0
 

Author Comment

by:detroitdr
Comment Utility
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?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now