Sub auto_open()
Dim MyButton As CommandBarControl
foundFlag = False
For Each cb In CommandBars("menu bar").Controls
If cb.Caption = "我的菜单(&M)" Then
foundFlag = True
End If
Next cb
If foundFlag Then
Exit Sub
Else
Set MyMenu = Application.CommandBars("menu bar").Controls.Add(Type:=msoControlPopup, temporary:=True)
MyMenu.Caption = "我的菜单(&M)"
Set MyButton = MyMenu.Controls.Add(msoControlButton)
With MyButton
.Style = msoButtonIconAndCaption
.BeginGroup = True
.Caption = "批量打印"
.FaceId = 122
.OnAction = "copyfromsheet"
End With
End If
End Sub
存成PPA文件就可以了.
[此贴子已经被作者于2004-6-13 0:00:59编辑过] |