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
385 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
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 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

17 Experts available now in Live!

Get 1:1 Help Now