C
Chip Pearson
For a client, I need to write a small PPT add-in (PPT 2003 SP2). I've never
written a PPT add-in before, but have written hundreds of Excel add-ins. My
questions are as follows:
"ActiveSlide" Does PPT have something like an "ActiveSlide" object that
refers slide that is currently active in PPT? How do you reference in VBA
code the slide that you are currently editing?
"ThisPresentation" Does PPT have something like "ThisPresentation" that
always refers to the presentation in which the running VBA code is located,
regardless of what presentation is active in PPT? In Excel, we have a
ThisWorkbook object that always refers to the workbook containing the code,
regardless of which workbook happens to be active.
If there is no "ThisPresentation" object, or some similar mechanism, how do
you programmatically assign the "OnAction" property of a standard
Office.CommandBarButton. In Excel, I'd use something like
Ctrl.OnAction = ThisWorkbook.Name & "!MacroName"
The "ThisWorkbook" refers to the workbook containing the code, not the
workbook that happens to be open. If there is no such thing, what do you
assign to the OnAction property to ensure it uses the macro in the correct
Presentation.
Finally, is there a way to run a macro whenever that presentation is opened
and closed (in the editor mode, not the slideshow mode)? In Excel, we have
the Aut
pen macro that Excel will automatically execute whenever the
workbook containing it is opened. Similarly, we have Auto_Close that will
run when the workbook is closed. Does PPT VBA have something similar? I need
to run code when my add-in is loaded. I'm starting to think that maybe I
should be writing a COM Add-In in VB6 rather than a PPA add-in.
Thanks in advance for any advice you could give.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)
written a PPT add-in before, but have written hundreds of Excel add-ins. My
questions are as follows:
"ActiveSlide" Does PPT have something like an "ActiveSlide" object that
refers slide that is currently active in PPT? How do you reference in VBA
code the slide that you are currently editing?
"ThisPresentation" Does PPT have something like "ThisPresentation" that
always refers to the presentation in which the running VBA code is located,
regardless of what presentation is active in PPT? In Excel, we have a
ThisWorkbook object that always refers to the workbook containing the code,
regardless of which workbook happens to be active.
If there is no "ThisPresentation" object, or some similar mechanism, how do
you programmatically assign the "OnAction" property of a standard
Office.CommandBarButton. In Excel, I'd use something like
Ctrl.OnAction = ThisWorkbook.Name & "!MacroName"
The "ThisWorkbook" refers to the workbook containing the code, not the
workbook that happens to be open. If there is no such thing, what do you
assign to the OnAction property to ensure it uses the macro in the correct
Presentation.
Finally, is there a way to run a macro whenever that presentation is opened
and closed (in the editor mode, not the slideshow mode)? In Excel, we have
the Aut
workbook containing it is opened. Similarly, we have Auto_Close that will
run when the workbook is closed. Does PPT VBA have something similar? I need
to run code when my add-in is loaded. I'm starting to think that maybe I
should be writing a COM Add-In in VB6 rather than a PPA add-in.
Thanks in advance for any advice you could give.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)