MS Access 2010 の VBA にて プリンタ枚数 を指定しても反映されない

症状

 
Private Sub PrintReport(inReportName As String, inPrinter As Printer, inCopiesNumber As Integer)
DoCmd.OpenReport inReportName, acViewDesign, , , acHidden
Set Application.Printer = inPrinter
Application.Printer.Copies = inCopiesNumber
DoCmd.OpenReport inReportName
DoCmd.Close acReport, inReportName, acSaveNo
Set Application.Printer = Nothing
End Sub

 対処

 Private Sub PrintReport(inReportName As String, inPrinter As Printer, inCopiesNumber As Integer)

DoCmd.OpenReport inReportName, acViewPreview DoCmd.SelectObject acReport, inReportName, False
Set Application.Printer = inPrinter
DoCmd.PrintOut , , , , inCopiesNumber
DoCmd.Close acReport, inReportName
Set Application.Printer = Nothing
End Sub

参考

http://support.microsoft.com/kb/2627824

コメント

このブログの人気の投稿

AppSheet の Data Source に Heroku Postgres を追加したい