老师:请问如何在打印按钮中设置横向打印?以下代码如何修改,请老师指教:
Select Case e.StripItem.Name
'慢病人员花名册
Case "print1"
e.Form.Strips("主菜单").Items("printgxy").BaseControl.HideDropDown '退出主菜单下的项目菜单"print"
Dim Book As New XLS.Book(ProjectPath & "Attachments\慢病人员花名册.xlsx")
Dim fl As String = ProjectPath & "Reports\慢病人员花名册.xlsx"
Book.Build()
Book.Save(fl)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Ws.PrintOut
App.Quit
Case "PrintPreview1"
' e.StripItem.ParentItem.BaseControl.HideDropDown
' Application.Doevents '退出子菜单项目
e.Form.Strips("主菜单").Items("printgxy").BaseControl.HideDropDown ''退出主菜单下的项目菜单"print"
Dim Book As New XLS.Book(ProjectPath & "Attachments\慢病人员花名册.xlsx")
Dim fl As String = ProjectPath & "Reports\慢病人员花名册.xlsx"
Book.Build()
Book.Save(fl)
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
App.Visible = True
ShowAppWindow("慢病人员花名册",2)
Ws.PrintPreview
App.Quit
Case "edit1"
e.Form.Strips("主菜单").Items("printgxy").BaseControl.HideDropDown ''退出主菜单下的项目菜单"print"
Dim Book As New XLS.Book(ProjectPath & "Attachments\慢病人员花名册.xlsx")
Dim fl As String = ProjectPath & "Reports\慢病人员花名册.xlsx"
Book.Build()
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
End Select