?
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
Medium Priority
?
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 18812205
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
ID: 18812319
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
ID: 18812356
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:detroitdr
ID: 18812995
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 2000 total points
ID: 18814861
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
ID: 18815033
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

765 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