Dim iBar As CommandBar
Dim iButton As CommandBarButton
Dim iCombo As CommandBarComboBox
Set iBar = Application.CommandBars.Add(Name:=("menuTreeView"), Position:=msoBarPopup, Temporary:=True)
With iBar
Set iButton = .Controls.Add(Type:=msoControlButton)
iButton.Caption = "增加 选定节点子节点(&A)"
iButton.OnAction = "Get_PopupMenuSelection"
iButton.Tag = "ADD"
iButton.FaceId = 240
End with
Dim iBar As Object 'CommandBar
Dim iButton As Object 'CommandBarButton
Dim iCombo As Object 'CommandBarComboBox
Set iBar = Application.CommandBars.Add(Name:=("menuTreeView"), Position:=5, Temporary:=True)
With iBar
Set iButton = .Controls.Add(Type:=1)
iButton.Caption = "增加 选定节点子节点(&A)"
iButton.OnAction = "Get_PopupMenuSelection"
iButton.Tag = "ADD"
iButton.FaceId = 240
End With作者: 鱼儿游游 时间: 2011-11-16 16:12
我试试,多谢小宝。{:soso_e181:}