How to reset changes to the Application.Printer object
This article applies to a Microsoft Access database (.accdb and.mdb) and to a Microsoft Access project (.adp).
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Note Not all printers and printer drivers support the functionality in the following sample code.
Note In Microsoft Office Access 2007, you only have to replace the report name "Catalog" with an available report for the sample code..
Private Sub PrintCatalogReport() Dim rpt As Report Application.Printer = Application.Printers(0) DoCmd.OpenReport "Catalog", acViewPreview, , , acHidden Set rpt = Reports!Catalog With rpt.Printer .BottomMargin = 720 .Copies = 2 .Duplex = acPRDPVertical 'Double sided .PaperBin = acPRBNLargeCapacity End With DoCmd.OpenReport "Catalog", acViewNormal DoCmd.Close acReport, "Catalog", acSaveNo Set Application.Printer = NothingEnd Sub
Artikli ID: 284286 – viimati läbi vaadatud: 06/15/2007 17:40:28 – redaktsioon: 6.2
- kbprogramming kbsettings kbprinters kbreport kbprint kbhowto KB284286