I just want to replace one original inventor command by mine. I have the VBA code, it functions, now I wondered if the best way to place it on the ribbon was to add my own button, then hide the original one, or if it was possible to only modify the command associated with the original button.
I think the first solution is better, as you said, so I let default command alone.
The other idea to just modify default button was I already tried to use default icon, near like you propose. The only difference is I don't save the icon as BMP but directly use the iPictureDisp object:
Dim oDef As ButtonDefinition
Set oDef = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateStylesCmd")
Dim oLargeIcon As IPictureDisp
Set oLargeIcon = oDef.LargeIcon
Dim oStandardIcon As IPictureDisp
Set oStandardIcon = oDef.StandardIcon
dim oNewDef as ButtonDefinition
Set NewDef = ThisApplication.CommandManager.ControlDefinitions.AddButtonDefinition(btDisplayName, btInternalName, btClassification, btClientId, btDescriptionText, btToolTipTxt, oStandardIcon, oLargeIcon, btButtonDisplay)
This functions, but icons seems not to be the same as default button (cf joined file). Colors, definition, and even the shape are different ! If I use your method, saving as BMP, I have the same result... Any idea about this difference ? And, how can I obtain the right icon (even if I modify ot after 😉 ) ?