J
Jim Gordon MVP
Here's the setup:
I created a toolbar called "BWTools" and I want to add the functionality
that comes with a built-in toolbar command along with that command's
pop-up submenu.
Both of the following syntax statements successfully add the desired
control to the existing "BWTools" toolbar:
Set MyBar = CommandBars("BWTools").Controls.Add(Id:=742)
or
Application.CommandBars("BWTools").Controls.Add Type:=msoControlPopup,
Id:=742, Before:=2
At this point I have the desired control and an empty stub that's
waiting for the submenu items.
The following syntax adds submenu items successfully (and even adds
pictures to the submenu items which I thought was impossible)
With MyBar
.Controls.Add Type:=msoControlButton, Id:=2, Before:=1
.Controls.Add Type:=msoControlButton, Id:=3, Before:=2
End With
So far so good. But I want to use the commands that would normally be on
this control in the pop-up submenu.
How do I figure out the ID numbers of the items that are on control 742
when you drag it to a toolbar? It is this command: (Toolbars > Customize
Menus and Toolbars > Commands > Grayscale settings)
-Jim
I created a toolbar called "BWTools" and I want to add the functionality
that comes with a built-in toolbar command along with that command's
pop-up submenu.
Both of the following syntax statements successfully add the desired
control to the existing "BWTools" toolbar:
Set MyBar = CommandBars("BWTools").Controls.Add(Id:=742)
or
Application.CommandBars("BWTools").Controls.Add Type:=msoControlPopup,
Id:=742, Before:=2
At this point I have the desired control and an empty stub that's
waiting for the submenu items.
The following syntax adds submenu items successfully (and even adds
pictures to the submenu items which I thought was impossible)
With MyBar
.Controls.Add Type:=msoControlButton, Id:=2, Before:=1
.Controls.Add Type:=msoControlButton, Id:=3, Before:=2
End With
So far so good. But I want to use the commands that would normally be on
this control in the pop-up submenu.
How do I figure out the ID numbers of the items that are on control 742
when you drag it to a toolbar? It is this command: (Toolbars > Customize
Menus and Toolbars > Commands > Grayscale settings)
-Jim