原帖由 feng474 于 2010-6-7 19:38 发表
老师,我想知道这个是怎么做的呀? - Sub NewAWReportToolbar()
- On Error Resume Next
- Dim arr As Variant, ID As Variant, I As Integer
- Dim Toolbar As CommandBar
- Application.CommandBars("AWReport3.0").Delete
- arr = Array("返回首页", "参数设置", "重算当前", "重算所有", " 预览 ", " 打印 ", " 导出 ", _
- "资产负债表", "损 益 表", "现金流量表", "现流表附表", "股权变动表", "报表列表", "退出系统")
- ID = Array(1016, 538, 215, 459, 109, 4, 531, 500, 278, 1837, 1750, 2114, 501, 1640)
- Set Toolbar =Application.CommandBars.Add("AWReport3.0", msoBarTop)
- With Toolbar
- .Protection = msoBarNoResize
- For I = 0 To UBound(arr)
- With .Controls.Add(Type:=msoControlButton)
- .Caption = arr(I)
- .FaceId = ID(I)
- .ToolTipText = arr(I)
- .BeginGroup = True
- .OnAction = "toolbar" & I + 1
- .Style = msoButtonIconAndCaptionBelow
- End With
- Next
- .Protection = msoBarNoChangeVisible + msoBarNoCustomize + msoBarNoMove + msoBarNoResize
- .Visible = True
- End With
- Set Toolbar = Nothing
- End Sub
复制代码 |