office交流网--QQ交流群号

Access培训群:792054000         Excel免费交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

access将报表内容打印成彩色

2020-10-30 08:00:00
tmtony8
原创
2798

设计好的报表 需要打印。一般来说打印机可以选择黑白打印和彩色打印。

如何利用代码指定打印机是以彩色还是黑白来打印输出。

DoCmd.OpenReport "报表1", acViewPreview  
Reports("报表2").Printer.ColorMode = acPRCMColor   '更改打印色彩模式为彩色



下面代码指定的窗体设置各种打印机设置

Sub SetPrinter(strFormname As String) 
 
 DoCmd.OpenForm strFormname, acDesign, acFormEdit, 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 acForm, strFormname, acSaveYes 
 
 
End Sub

分享