Installation of the menu in Word and process the menu Click on the code -

zhaozj2021-02-17  50

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

转载请注明原文地址:https://www.9cbs.com/read-31092.html

New Post(0)