G
Goody
I have written a PowerPoint macro that I would like to run when a new
presentation is started using the template containing the macro. I have
declared an object variable in a class module, but apparently I need to
automate the initialization of the declared object from another module.
I have tried listing the code in the App_NewPresentation subroutine, but
that doesn't work. My macro, shown below, installs a control in the Frames
context menu. Selecting the control should run the SecondSlide macro, which
is located in a module. The macro itself works as intended, when run from a
module, but I need to automate it so that the context menu is modified as
soon as a new presentation is created. Can this be done?
Set myControl = CommandBars("Frames").Controls _
.Add(Type:=msoControlButton, Before:=1) ' Add new control at start of
Frames menu.
With myControl
.Caption = "Select Second Slide" ' Define caption.
.OnAction = "SecondSlide" ' Identify macro to run.
End With
What am I overlooking?
presentation is started using the template containing the macro. I have
declared an object variable in a class module, but apparently I need to
automate the initialization of the declared object from another module.
I have tried listing the code in the App_NewPresentation subroutine, but
that doesn't work. My macro, shown below, installs a control in the Frames
context menu. Selecting the control should run the SecondSlide macro, which
is located in a module. The macro itself works as intended, when run from a
module, but I need to automate it so that the context menu is modified as
soon as a new presentation is created. Can this be done?
Set myControl = CommandBars("Frames").Controls _
.Add(Type:=msoControlButton, Before:=1) ' Add new control at start of
Frames menu.
With myControl
.Caption = "Select Second Slide" ' Define caption.
.OnAction = "SecondSlide" ' Identify macro to run.
End With
What am I overlooking?