Setting Printing Options via VBA

G

Guest

Hi all:
Can anyone tell me how to set the printing options with VBA? I am using
Access 2000. What I need to do is print a "tag" for each unit recieved to a
specified printer. The number of tags to be printed is contaned in a text
box (txtBinQty) on a form and the name of the report is rptLotTag.

Any help would be greatly appreciated.

Thanks,
FatMan
 
G

Guest

FatMan,

Use the Copy property of the Printer object in the Printers collection.

Application.Printers("GB Label Printer").Copies = 3

'(Print report, the reset number of copies.)

Application.Printers("GB Label Printer").Copies = 1


This is from Access Help. It shows all of the properties:

With Forms(0).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

Bruce
 
G

Guest

Bruce:
Thanks for the help.

Is "GB Label Printer" the name of the printer the print job is being sent to
and if so is this the windows printer name?

How do I tell it the tag size is 4"X6"?

Thanks,
FatMan
 
G

Guest

Bruce:
Thanks for the help.

Is "GB Label Printer" the name of the printer the print job is being sent to
and if so is it the windows printer name?

How do I tell Access the tag size is 4"x6"?

Thanks,
FatMan
 
G

Guest

Is "GB Label Printer" the name of the printer the print job is being sent to
and if so is it the windows printer name?

Yes, "GB Label Printer" is the windows name for the printer. You can also
use the printer's index, e.g. Application.Printers(0).Copies = 3
How do I tell Access the tag size is 4"x6"?
Never played with this much, but try

With Application.Printers("GB Label Printer")
.Copies = 3
.DefaultSize = False
.ItemSizeHeight = (1440 * 4)
.ItemSizeWidth = (1440 * 6)
End Width

Help doesn't say but, from the example in Help, it looks like the height and
width are set in Twips (1440 per inch).

You really should read through the description of the Printers Collection,
Printer Object, and the various Printer Object properties in VBA Help. Show
the code for a form or report, then click the Help button at the top. Going
into help this way shows you the VBA help versus the regular Access Help.

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top