dbTalk Databases Forums  

printing and pre-selecting paperbin?

comp.databases.ms-access comp.databases.ms-access


Discuss printing and pre-selecting paperbin? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gerhard
 
Posts: n/a

Default printing and pre-selecting paperbin? - 07-14-2011 , 07:05 AM






hi,

i have an access application with several reports which are printed on
different printers

the printing is always 1 original and 1 copy which should be printed on
paper from different sources of the printer

now i'd like to have the possibility to preselect the paper bins for the
various reports on various printers

so i create a table with the following columns

reportname
printer
copy1
copy2

reportname - printer - copy1 - copy2
invoice - office printer - tray1 - tray2

when printing the report invoice i look in the table on which tray copy
1 and on which tray copy 2 is to be printed

the problem now is, how do i make this preselection, as in select the
printer and select from which tray the copy1 for the invoice should be
printed

i would need to know how i can get a list of all the papersources a
selected printer offers and then select one and save the information in
the table/field

problem is how to get the papersource ?

thanks

Reply With Quote
  #2  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: printing and pre-selecting paperbin? - 07-14-2011 , 10:20 AM






This possibly may help. The two routines are from Help. You aren't going to be told how many bins there are, but you can get the current bin and you can set the bin prior to printing.

Sub PrinterList()
'from A2007 help on Printers
Dim prtLoop As Printer

For Each prtLoop In Application.Printers
With prtLoop
MsgBox "Device name: " & .DeviceName & vbCr _
& "Driver name: " & .DriverName & vbCr _
& "Port: " & .Port & vbCr _
& "Paperbin: " & CStr(.PaperBin) & vbCr _
& "Duplex: " & CStr(.Duplex)
End With
Next prtLoop
End Sub
Sub SetPrinter(strFormname As String)
'from A2007 help on search of Paperbin
DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).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

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes
End Sub

Reply With Quote
  #3  
Old   
Gerhard
 
Posts: n/a

Default Re: printing and pre-selecting paperbin? - 07-15-2011 , 12:56 AM



thanks,

i'll try some of your code too, i've already found some code on the
internet myself which also works

now i have another question which so far i have not found a solution for:

i distribute an ade in which as you know reports can not be edited but i
need to send the report to a specified printer using a specified
papersource depending on the user who is printing the report

how can i - in the runtime - manipulate the report so it get's printed
on a specified printer using a specified papersource

can this even be done in the runtime (ade)?

thanks

On 14.07.2011 17:20, Patrick Finucane wrote:
Quote:
This possibly may help. The two routines are from Help. You aren't going to be told how many bins there are, but you can get the current bin and you can set the bin prior to printing.

Sub PrinterList()
'from A2007 help on Printers
Dim prtLoop As Printer

For Each prtLoop In Application.Printers
With prtLoop
MsgBox "Device name: "& .DeviceName& vbCr _
& "Driver name: "& .DriverName& vbCr _
& "Port: "& .Port& vbCr _
& "Paperbin: "& CStr(.PaperBin)& vbCr _
& "Duplex: "& CStr(.Duplex)
End With
Next prtLoop
End Sub
Sub SetPrinter(strFormname As String)
'from A2007 help on search of Paperbin
DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).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

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes
End Sub

Reply With Quote
  #4  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: printing and pre-selecting paperbin? - 07-15-2011 , 01:18 PM



On Jul 15, 12:56*am, Gerhard <phleb... (AT) hardlin0r (DOT) com> wrote:
Quote:
thanks,

i'll try some of your code too, i've already found some code on the
internet myself which also works

now i have another question which so far i have not found a solution for:

i distribute an ade in which as you know reports can not be edited but i
need to send the report to a specified printer using a specified
papersource depending on the user who is printing the report

how can i - in the runtime - manipulate the report so it get's printed
on a specified printer using a specified papersource

can this even be done in the runtime (ade)?

thanks

On 14.07.2011 17:20, Patrick Finucane wrote:



This possibly may help. *The two routines are from Help. * You aren't going to be told how many bins there are, but you can get the current bin and you can set the bin prior to printing.

Sub PrinterList()
* * *'from A2007 help on Printers
* * *Dim prtLoop As Printer

* * *For Each prtLoop In Application.Printers
* * * * *With prtLoop
* * * * * * *MsgBox "Device name: "& *.DeviceName& *vbCr _
* * * * * * * * *& *"Driver name: "& *.DriverName& *vbCr _
* * * * * * * * *& *"Port: "& *.Port& *vbCr _
* * * * * * * * *& *"Paperbin: "& *CStr(.PaperBin)& *vbCr _
* * * * * * * * *& *"Duplex: "& *CStr(.Duplex)
* * * * *End With
* * *Next prtLoop
End Sub
Sub SetPrinter(strFormname As String)
* * *'from A2007 help on search of Paperbin
* * *DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
* * * * * * * * * * datamode:=acFormEdit, windowmode:=acHidden

* * *With Forms(form1).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

* * *DoCmd.Close objecttype:=acForm, objectname:=strFormname,_
* * * * * * * * *Save:=acSaveYes
End Sub- Hide quoted text -

- Show quoted text -
I honestly do not know as I am not running apps in a runtime
environment. But I would think if your reports are set to a default
printer, and you modify the Application.Printers settings, it should
work. Google for Application.Printer =
Application.Printers("PrinterName"). Maybe you'll getr some hits.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.