K
Kim
Below is part of a macro I use to add a new menu with a drop-down
listing of the macros I need to use. I would like to add a picture
next to the name of the menu item (so the menu item will show the
picture, then the name of the menu item). I can customize the menu at
the menu bar, but it doesnt stay after I save a new .ppa file so I
need to get this into the code. Can anyone provide me the missing line
item I need to do this?
Option Explicit
Sub auto_open()
Dim cbmCommandBarMenu As CommandBar
Dim cbmPPTMacros As CommandBarPopup
Dim cbmCommandBarMenuCascade As CommandBarPopup
' Clear the way for new menu
On Error Resume Next
Application.CommandBars("Menu Bar").Controls("PPT Macros").Delete
' Identify built-in menu bar to work with
Set cbmCommandBarMenu = Application.CommandBars("Menu Bar")
' Add the new menu bar item: PPT Macros
With cbmCommandBarMenu.Controls
' By not specifying "Before", new menu will appear after Help menu
'Set cbmPPTMacros = .Add(Type:=msoControlPopup, Before:=10)
Set cbmPPTMacros = .Add(Type:=msoControlPopup)
' Set caption for new menu.
With cbmPPTMacros
.Caption = "PPT Macros"
' Add single menu item and set properties
With .Controls.Add(msoControlButton)
.OnAction = "OpenMSWordObject"
.Caption = "&A Open MSWord Object"
End With
listing of the macros I need to use. I would like to add a picture
next to the name of the menu item (so the menu item will show the
picture, then the name of the menu item). I can customize the menu at
the menu bar, but it doesnt stay after I save a new .ppa file so I
need to get this into the code. Can anyone provide me the missing line
item I need to do this?
Option Explicit
Sub auto_open()
Dim cbmCommandBarMenu As CommandBar
Dim cbmPPTMacros As CommandBarPopup
Dim cbmCommandBarMenuCascade As CommandBarPopup
' Clear the way for new menu
On Error Resume Next
Application.CommandBars("Menu Bar").Controls("PPT Macros").Delete
' Identify built-in menu bar to work with
Set cbmCommandBarMenu = Application.CommandBars("Menu Bar")
' Add the new menu bar item: PPT Macros
With cbmCommandBarMenu.Controls
' By not specifying "Before", new menu will appear after Help menu
'Set cbmPPTMacros = .Add(Type:=msoControlPopup, Before:=10)
Set cbmPPTMacros = .Add(Type:=msoControlPopup)
' Set caption for new menu.
With cbmPPTMacros
.Caption = "PPT Macros"
' Add single menu item and set properties
With .Controls.Add(msoControlButton)
.OnAction = "OpenMSWordObject"
.Caption = "&A Open MSWord Object"
End With