1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| Public Sub CREATE_POPUPMENU_Tri()
'' Dim newMenu As CommandBarControl
'' Dim newMenu_Essai As CommandBar
Dim cmb As CommandBar
Dim mBtn As CommandBarButton
On Error Resume Next
'Si le Menu existe déjà on le supprime
CommandBars("Tr").Delete
Set cmb = CommandBars.Add("Tr", msoBarPopup, False, False)
With cmb
.Controls.Add(msoControlButton, 21, , , True).BeginGroup = True 'Cut
.Controls.Add msoControlButton, 19, , , True 'Copy
.Controls.Add msoControlButton, 22, , , True 'Paste
.Controls.Add msoControlButton, 12329, , , True 'mode fd
.Controls.Add msoControlButton, 502, , , True 'mode fm
.Controls.Add msoControlButton, 478, , , True 'suppr
'Le Sous-Menu
'' Set newMenu = .Controls.Add(msoControlButton, 31581) 'Sous Menu Text Filters
'' With newMenu
Set mBtn = cmb.Controls.Add(msoControlButton, 1567) 'Quitter le Formulaire
With mBtn
'Bouton avec une icône et un libellé
.Style = msoButtonIconAndCaption
.Caption = "On ferme"
End With
'' Set mBtn = cmb.Controls.Add(msoControlButton) 'bouton perso
'' With mBtn
'' 'Bouton avec une icône et un libellé
'' .Style = msoButtonIconAndCaption
'' .Caption = "Affiche info"
'' '.OnAction = "=AffichInfo()" ' fonction
'' .OnAction = "AffichInfo" ' sub
'' Dim picImage As IPictureDisp
'' 'Set picImage = Application.CommandBars("DATABASE").Controls(2).Picture
'' Set picImage = LoadPicture("D:\image.gif")
'' .Picture = picImage
'' End With
'' ' Les Boutons qui sont dans le sous-Menu Text Filters
.Controls.Add msoControlButton, 210, , , True 'Sort Ascending
.Controls.Add msoControlButton, 211, , , True 'Sort Decending
.Controls.Add msoControlButton, 640, , , True 'Filter By Selection
'' .Controls.Add msoControlButton, 605, , , True 'Remove Filter/Sort
'' .Controls.Add msoControlButton, 3017, , , True 'Filter Excluding Selection
'' .Controls.Add(msoControlButton, 10068, , , False).BeginGroup = True 'Filter equals xx
'' .Controls.Add msoControlButton, 10071, , , False 'Filter not equal to xx
'' .Controls.Add msoControlButton, 10076, , , False 'Filter contains xx
'' .Controls.Add msoControlButton, 10089, , , False 'Filter does not contains xx
'' .Controls.Add(msoControlButton, 141, , , False).BeginGroup = True 'Find in form
''
'' .Controls.Add msoControlButton, 10077, , , True 'Filter equals xx
'' .Controls.Add msoControlButton, 10078, , , True 'Filter not equal to xx
'' .Controls.Add msoControlButton, 10079, , , True 'Filter beings with xx
'' .Controls.Add msoControlButton, 12696, , , True 'Filter does not beings with xx
'' .Controls.Add msoControlButton, 10080, , , True 'Filter contains xx
'' .Controls.Add msoControlButton, 10081, , , True 'Filter does not contains xx
'' .Controls.Add msoControlButton, 10082, , , True 'Filter ends with xx
'' .Controls.Add msoControlButton, 10083, , , True 'Filter ends with xx
'' .Controls.Add msoControlButton, 12697, , , True 'Filter does not ends with xx
'' .Controls.Add msoControlButton, 10062, , , True 'Filter between
'' .Controls.Add msoControlButton, 12698, , , True 'Filter before xx
'''' End With
End With
Set cmb = Nothing
'' Set newMenu = Nothing
End Sub |
Partager