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

コメント

このブログの人気の投稿

pip install mojimoji failed

Windows Server 2008 R2 & PHP 5.6(64bit)

rake db:migrate RAILS_ENV=production にて uninitialized constant Backlogs::IssueQueryPatch::RbRelease のエラーが出る