S
Susan Kong
Hi there,
I tried to add customized menu to WORD menu, but I can only add 7 submenu
items to the menu "Mymenu". Anybody knows why?
Here is my code:
Set myMenuBar = CommandBars.ActiveMenuBar
Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup, _
Temporary:=True)
newMenu.Caption = "Mymenu"
Set ctrl1 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=1)
With ctrl1
..Caption = "HP_Prepare_SRC"
..TooltipText = "HP_Prepare_SRC"
..Style = msoButtonCaption
..OnAction = "HP_Prepare_SRC"
End With
Set ctrl2 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=2)
With ctrl2
..Caption = "HP_Prepare_HHCHHK"
..TooltipText = "HP_Prepare_HHCHHK"
..Style = msoButtonCaption
..OnAction = "HP_Prepare_HHCHHK"
End With
.......
Thanks!
Best regards
Susan
I tried to add customized menu to WORD menu, but I can only add 7 submenu
items to the menu "Mymenu". Anybody knows why?
Here is my code:
Set myMenuBar = CommandBars.ActiveMenuBar
Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup, _
Temporary:=True)
newMenu.Caption = "Mymenu"
Set ctrl1 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=1)
With ctrl1
..Caption = "HP_Prepare_SRC"
..TooltipText = "HP_Prepare_SRC"
..Style = msoButtonCaption
..OnAction = "HP_Prepare_SRC"
End With
Set ctrl2 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=2)
With ctrl2
..Caption = "HP_Prepare_HHCHHK"
..TooltipText = "HP_Prepare_HHCHHK"
..Style = msoButtonCaption
..OnAction = "HP_Prepare_HHCHHK"
End With
.......
Thanks!
Best regards
Susan