下面我设置的打印代码没有问题,但是现在是我想把A4纸改为和A4一样宽的纸张,但是高度是无限的自定义纸,这样打印的时候可以不分页,可以一直把要打印的内容打印完,下面的代码应该怎么改啊。真诚恳请高手给帮忙!!!!!
Dim Book As New XLS.Book(ProjectPath & "Attachments\报表模板\配料表.xls")
Dim fl As String = ProjectPath & "Reports\报表模板\配料表.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
With Sheet.PrintSetting
.PaperKind = 9 '设为A4纸
.LandScape = False '竖排打印(横向打印改为true)
.MarginLeft = 12 '左边距设为12毫米
.MarginRight = 10 '右边距设为10毫米
.MarginTop = 10 '上边距设为15毫米
.MarginBottom = 15 '下边距设为15毫米
End With
With Sheet.PrintSetting
'页眉左边为日期,中间为时间,右边为表名
'.Header = "&L&D &C&T &R&A"
'在页脚右边打印页号和总页数
.Footer = "&R第&P页,总&N页"
End With
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()