![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 - |
![]() |
| Thread Tools | |
| Display Modes | |
| |