请老师:我用以下代码对二级菜单有效,对三级菜单就无效了,请老师修改一下代码:
Select Case e.StripItem.Name
'特殊大病门诊慢性病补偿初审表
Case "print1"
e.Form.Strips("主菜单").Items("printgxy").BaseControl.HideDropDown '退出主菜单下的项目菜单"printgxy"
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 ''退出主菜单下的项目菜单"printgxy"
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 ''退出主菜单下的项目菜单"printgxy"
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
菜单如图所示:
此主题相关图片如下:123.png