Does anyone know if its possible to assigning a customized faceid (bitmap,picture) to a toolbar menu item.
I know manually I can edit the button image but I want to automate the process. I currently have some code that creates a tool bar every time the workbook is opened and destroys it every time it is closed.
Thanks
Tball
‘ **************************************
Sub CreateToolbarMenu()
Dim NewToolBarMenu As CommandBar
Dim NewToolBarItem As CommandBarControl
Set NewToolBarMenu = Application.CommandBars.Add("newToolbar")
NewToolBarMenu.Visible = True
Set NewToolBarItem = NewToolBarMenu.Controls.Add
With NewToolBarItem
.Caption = "New Button"
.OnAction = "MacroName"
.Tag = "my_toolbars"
.FaceId = 346
‘ I want to replace 346 with a bmp or picture
‘ or somehow draw my own faceid
End With
End Sub
‘ **************************************
Sub DestryToolbarMenu()
Dim ToolBarMenu As CommandBar
Dim NewToolBarItem As CommandBarControl
Set ToolBarMenu = Application.CommandBars("newToolbar")
ToolBarMenu.Delete
End Sub
I know manually I can edit the button image but I want to automate the process. I currently have some code that creates a tool bar every time the workbook is opened and destroys it every time it is closed.
Thanks
Tball
‘ **************************************
Sub CreateToolbarMenu()
Dim NewToolBarMenu As CommandBar
Dim NewToolBarItem As CommandBarControl
Set NewToolBarMenu = Application.CommandBars.Add("newToolbar")
NewToolBarMenu.Visible = True
Set NewToolBarItem = NewToolBarMenu.Controls.Add
With NewToolBarItem
.Caption = "New Button"
.OnAction = "MacroName"
.Tag = "my_toolbars"
.FaceId = 346
‘ I want to replace 346 with a bmp or picture
‘ or somehow draw my own faceid
End With
End Sub
‘ **************************************
Sub DestryToolbarMenu()
Dim ToolBarMenu As CommandBar
Dim NewToolBarItem As CommandBarControl
Set ToolBarMenu = Application.CommandBars("newToolbar")
ToolBarMenu.Delete
End Sub