sub test()  Set Bar = Application.CommandBars("文件")  ButtonID = Bar.GetReserveCommandID()  Set NewPopMenu = Bar.Controls.Add(wpsControlPopup, Before:=7)  NewPopMenu.Caption = "其他"  Set NewSubMenu=Application.CommandBars(NewPopMenu.Caption).Controls.Add(wpsControlButton,Id:=ButtonID)  NewSubMenu.Caption = "這是新增的菜單項"  NewSubMenu.OnAction = "OnNewMenu"  NewSubMenu.CommandObject = Me  End Sub  Sub OnNewMenu(hWnd As Long)  MsgBox "New Menu Add OK!"  End Sub