Sub AffFindView()
Dim niv0 As CommandBarPopup, niv1 As CommandBarPopup, niv2 As CommandBarPopup
Dim niv3 As CommandBarPopup, niv4 As CommandBarButton
With Application.CommandBars(1)
.Controls(1).Visible = False 'masque le menu fichiers
Set niv0 = .Controls.Add(Type:=msoControlPopup, Before:=1)
With niv0
.Caption = "FindView"
For i = 1 To 3
Set niv1 = .Controls.Add(Type:=msoControlPopup)
With niv1
.Caption = "Menu " & i
.BeginGroup = True
For j = 1 To 3
Set niv2 = .Controls.Add(Type:=msoControlPopup)
With niv2
.Caption = "Menu " & i & "." & j
.BeginGroup = True
For k = 1 To 3
Set niv3 = .Controls.Add(Type:=msoControlPopup)
With niv3
.Caption = "Menu " & i & "." & j & "." & Chr(96 + k)
.BeginGroup = True
Set niv4 = .Controls.Add(Type:=msoControlButton)
With niv4
.Caption = "Macro " & i & "." & j & "." & Chr(96 + k)
.Style = msoButtonCaption
.BeginGroup = True
' adapter suivant le nom des macros
.OnAction = "Macro_" & i & "_" & j & "_" & Chr(96 + k)
End With
End With
Next
End With
Next
End With
Next
End With
End With
End Sub