We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Function CreateCMenu() On Error Resume Next CommandBars("MyContext").Delete Dim cmb As CommandBar 'Object Dim cmbBtn1 As CommandBarButton 'Object Dim cmbBtn2 As CommandBarButton 'Object Set cmb = CommandBars.Add("MyContext", _ msoBarPopup, False, False) ' msoBarPopup = 5 With cmb ' add cut, copy, and paste buttons with the "magic number" technique that assigns ' appearance and behavior. The magic number goes in as the second parameter .Controls.Add msoControlButton, _ 21, , , True ' 21=Cut, msoControlButton=1 .Controls.Add msoControlButton, _ 19, , , True '19= Copy .Controls.Add msoControlButton, _ 22, , , True ' 22=Paste ' add customized buttons with our caption and function name -- second param is blank Set cmbBtn1 = .Controls.Add(msoControlButton, _ , , , True) With cmbBtn1 .BeginGroup = True .Caption = "Create New" .OnAction = "=CreateNewOrder()" .FaceID = 59 'smiley face End With Set cmbBtn2 = .Controls.Add(msoControlButton, _ , , , True) With cmbBtn2 .Caption = "Reset" .OnAction = "=ClearOrder()" End With End With End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.