SUB CREATE_MENU () const me_name as string = "my new main_menu" DIM Before_Number AS INTEGER DIM X AS INTEGER
ON Error ResMe Next Commandbars ("Menu Bar"). Controls (Menu_name). Deleted the last menu Before_Number = Commandbars ("Menu Bar"). Controls.count 1
Err.clear x = 1 'Delete History Custom Menu Do Until Err.Number <> 0 Commandbars ("Custom Popup" & X) .delete X = X 1 Loop Err.Clear Commandbars ("Menu Bar"). Controls. Add Type: = msoControlPopup, Before: = Before_number CommandBars ( "Menu Bar") Controls (Before_number) .Caption = menu_Name For X = access code CommandBars' here may be added to the database 1 to 10 ( "Custom Popup 1") Controls.. .Add type: = msoControlButton, Before: = x Commandbars ("CUSTOM POPUP 1"). Controls (x) .caption = "suction sea slope" & x Commandbars ("Custom Popup 1"). Controls (x) .onaction = "Newmacros.proc_menu" Next
End Sub
Sub proc_menu () 'Here you can join the process code msgbox commandbars.ActionControl.caption end sub