The manual tool bar customization is a Program level function. It stays
with the program. If you open a PowerPoint without your macros, the
customizations still remain on your system.
However, the Macro's themselves can be Presentation level (travel with the
presentation) or Add-ins to the Program level (stay with computer).
It sounds like you should make the toolbars into a Program level Auto_Open.
This will flag all sorts of alarms on a recieving computer about security,
but ... if they want the bling, they gotta click the OK button(s). You will
also want to evaluate if the tool bar you are creating exists, before you
create another copy of it.
Bill Dilworth
I didn't create the toolbar using code, I just created a new toolbar
using custom. So I think you're saying I need to create a custom
toolbar by creating the code and save it with my other macros. Would
you happen to have the code (or know where I can find it) to create
the toolbar on opening PPT? I can copy code from Word to do this, but
I know things are different in PowerPoint.- Hide quoted text -
- Show quoted text -
Ok, I got a little closer. I was able to use the code below from Word
which I use to create a new menu item.
Option Explicit
AddToolbar
End Sub
Sub AddToolbar()
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
' Add single menu item and set properties
With .Controls.Add(msoControlButton)
.OnAction = "PlacemarkPosition"
.Caption = "&B First Placemark Position (H=.75, V=1.54)"
End With
' Add single menu item and set properties
With .Controls.Add(msoControlButton)
.OnAction = "Footnote"
.Caption = "&C Footnote = Select Footnote text box
first"
End With
End With
' Add submenu: Header/Footer Macros
Set cbmCommandBarMenuCascade = cbmPPTMacros.Controls.Add
(msoControlPopup)
With cbmCommandBarMenuCascade
.Caption = "&D Symbols"
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&A Division"
.OnAction = "Division"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&B Minus"
.OnAction = "Minus"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&C Multiplication"
.OnAction = "Multiplication"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&D Greater Than"
.OnAction = "GreaterThan"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&E Less Than"
.OnAction = "LessThan"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&F 1/2"
.OnAction = "OneHalf"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&G 1/4"
.OnAction = "OneQuarter"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&H 3/4"
.OnAction = "ThreeQuarter"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&I 1/3"
.OnAction = "OneThird"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&J 2/3"
.OnAction = "TwoThirds"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&K 1/8"
.OnAction = "OneEighth"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&L 3/8"
.OnAction = "ThreeEighth"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&M 5/8"
.OnAction = "FiveEight"
End With ' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&N 7/8"
.OnAction = "SevenEighth"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&O Registered"
.OnAction = "Registered"
End With
' Add cascading menu item and set properties
With .Controls.Add(msoControlButton)
.Caption = "&P Trademark"
.OnAction = "Trademark"
End With
End With
End With
End Sub
The macro above will add the new menu, but in order for the new menu
to show up I first need to open the .ppt where I have all the macros
stored, and run the Add Toolbar macro. This seems to open the toolbar,
and keeps it there. I wish I didn't have to go through all the steps
to get it to show, but I'm just happy that it's working. If you have
any suggestions about my code please let me know. Thanks again for
steering me in the right direction!