设置ColorMode以在VBA中打印Access Report

时间:2014-08-21 14:34:12

标签: printing access-vba

使用VBA设置访问报告的打印属性时出现问题。 我试图使用

设置值
Application.Printer.PrintQuality = acPRPQHigh
Application.Printer.PaperSize = acPRPSA5
Application.Printer.ColorMode = acPRCMColor

使用

Debug.Print Application.Printer.Device

我测试了Application.Printer是否设置为正确的打印机,就是这种情况。 但是,使用

打印报告时,不会使用这些属性
DoCmd.OpenReport "Report"

1 个答案:

答案 0 :(得分:0)

我可以帮助你吗?每个报告都有自己的打印机对象,因此您应该使用

MyReport.Printer.PrintQuality = acPRPQHigh
MyReport.Printer.PaperSize = acPRPSA5
MyReport.Printer.ColorMode = acPRCMColor

或在Report_Activate中:

Private Sub Report_Activate()
    Set Me.Printer = Application.Printer
End Sub