Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to hide a predefined set of slides using a macro?

1,417 views
Skip to first unread message

Grinde@discussions.microsoft.com Christopher Grinde

unread,
Jun 5, 2007, 2:16:01 PM6/5/07
to
I have one huge ppt-file that I would like to use in several different
configurations. It is always updated, and rather than having to hide the same
slides time after time, I would like to have several 'configurations', for
instance one short version, one medium length version and one full version.
Then I wish to be able to switch between these via an macro that hides or
shows a subset of all the slides in the same presentation.
How do I do this? I do know OOP, but have never bothered to learn VB.


David M. Marcovitz

unread,
Jun 5, 2007, 3:40:30 PM6/5/07
to
The easiest thing to do is to create custom shows. You can create a custom
show for each different configuration and have a menu slide that hyperlinks
to the custom shows. VBA can work for this, but it is not necessary.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?Q2hyaXN0b3BoZXIgR3JpbmRl?= <Christopher
Gri...@discussions.microsoft.com> wrote in
news:CC05306B-6981-4AAC...@microsoft.com:

PPTMagician

unread,
Jun 5, 2007, 6:52:00 PM6/5/07
to
Rather than resorting to VB, why don't you create 3 custom shows with a menu
slide to launch the appropriate one?
--
Thanks,
Glenna Shaw
Microsoft PowerPoint MVP Team
http://www.pptmagic.com

aneasiertomorrow

unread,
Jun 5, 2007, 7:24:02 PM6/5/07
to
Hi Christopher

This is exactly what Custom Shows are for - set up as many as you want then
have a link to each from a 'front page' slide. You should find all the info
you need on creating custom shows here:
http://office.microsoft.com/en-au/powerpoint/HP051928141033.aspx?pid=CH063500731033
If not, post back (with your version) and I'll go into more detail.

Lucy
--
MOS Master Instructor
www.aneasiertomorrow.com.au

If this post answered your question please let us know as others may be
interested too

aneasiertomorrow

unread,
Jun 5, 2007, 9:40:00 PM6/5/07
to
I'm sure I replied to this this morning but nothing's showing up...

Hi Christopher

You don't need VBA, just Custom Shows and a 'front page' slide with links to
launch the one you need. See here for how to set them up:
http://office.microsoft.com/en-us/powerpoint/CH063500731033.aspx

If you need more info post back with which version you use.

Lucy
--
MOS Master Instructor
www.aneasiertomorrow.com.au

If this post answered your question please let us know as others may be
interested too

tohlz

unread,
Jun 6, 2007, 12:08:07 AM6/6/07
to
You can make use of custom shows to do that rather than VB.

For instance, click Slide Show > Custom Shows. Click New. Set a new name for
custom show 1 (e.g. Short Version). Add the slides that you want to display
during slide show. Once you are done, click ok.

Now, add a menu slide.
Add an action button that hyperlinks to the custom show 1.
Have it show and return.
Repeat the steps for medium and full version.
--
Shawn Toh (tohlz)
Microsoft MVP PowerPoint

Site Updated: May 19, 2007
9 new PowerPoint Artworks
http://pptheaven.mvps.org
PowerPoint Heaven - The Power to Animate

Rae Drysdale

unread,
Jun 6, 2007, 1:08:01 PM6/6/07
to
Have you considered using custom shows? It sounds just right for what you
want to do.
--
Rae Drysdale

kraves

unread,
Jun 6, 2007, 7:10:00 PM6/6/07
to
Sorry not a detailed answer but if it was me, I'd head this way.

Have Slide 1 as your Admin/Menu slide, say containing 2 buttons
Short/Med/Long which runs the macro then advances to first slide (i.e. next
slide)

Sounds like you are planning to have fixed slides each time, so could
hardcode the slide numbers in an Array for each subset required.

Then iterate through each slide checking against the array if false then
hide the slide.

Probably best to reset (un-hide) all slides each time you run the pres.

Easiest way to get a handle on where powerpoint hides things in its object
model is to record a macro manually. Then Alt-F11 and pick out the fragments
you want.

Kyle.

Clemens Saur

unread,
Aug 21, 2010, 12:17:59 AM8/21/10
to
My solution to your problem:

Place a named "Marker" on each slide.
Then Show/Hide depending if the marker is on a slide.
You can change the slides continuously and keep the versions upto date without worrying about changing page numbers.

Private Sub Button_Engineering_Click()
Dim Show_Slide As Boolean
Dim oSl As Slide
Dim oSh As Shape

Show_Slide = False
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.Name = "Engineers" Then Show_Slide = True
Next
If Show_Slide = True Then oSl.SlideShowTransition.Hidden = False
If Show_Slide = False Then oSl.SlideShowTransition.Hidden = True
Show_Slide = False

Next
End Sub

Private Sub Button_Mgmt_Click()
Dim Show_Slide As Boolean
Dim oSl As Slide
Dim oSh As Shape

Show_Slide = False
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.Name = "Mgmt" Then Show_Slide = True
Next
If Show_Slide = True Then oSl.SlideShowTransition.Hidden = False
If Show_Slide = False Then oSl.SlideShowTransition.Hidden = True
Show_Slide = False

Next
End Sub

Private Sub Button_Show_All_Click()
Dim oSl As Slide
Dim oSh As Shape
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
oSl.SlideShowTransition.Hidden = False
Next
Next
End Sub


>> On Tuesday, June 05, 2007 3:40 PM David M. Marcovitz wrote:

>> The easiest thing to do is to create custom shows. You can create a custom
>> show for each different configuration and have a menu slide that hyperlinks
>> to the custom shows. VBA can work for this, but it is not necessary.
>> --David
>>
>> --
>> David M. Marcovitz
>> Microsoft PowerPoint MVP
>> Director of Graduate Programs in Educational Technology
>> Loyola College in Maryland
>> Author of _Powerful PowerPoint for Educators_
>> http://www.PowerfulPowerPoint.com/
>>
>> =?Utf-8?B?Q2hyaXN0b3BoZXIgR3JpbmRl?= <Christopher
>> Gri...@discussions.microsoft.com> wrote in
>> news:CC05306B-6981-4AAC...@microsoft.com:


>>> On Tuesday, June 05, 2007 6:52 PM PPTMagicia wrote:

>>> Rather than resorting to VB, why don't you create 3 custom shows with a menu
>>> slide to launch the appropriate one?
>>> --
>>> Thanks,
>>> Glenna Shaw
>>> Microsoft PowerPoint MVP Team
>>> http://www.pptmagic.com
>>>
>>>
>>>
>>> "Christopher Grinde" wrote:


>>>> On Tuesday, June 05, 2007 7:24 PM aneasiertomorro wrote:

>>>> Hi Christopher
>>>>
>>>> This is exactly what Custom Shows are for - set up as many as you want then
>>>> have a link to each from a 'front page' slide. You should find all the info
>>>> you need on creating custom shows here:
>>>> http://office.microsoft.com/en-au/powerpoint/HP051928141033.aspx?pid=CH063500731033
>>>> If not, post back (with your version) and I'll go into more detail.
>>>>

>>>> Lucy
>>>> --
>>>> MOS Master Instructor
>>>> www.aneasiertomorrow.com.au
>>>>
>>>> If this post answered your question please let us know as others may be
>>>> interested too
>>>>
>>>>
>>>> "Christopher Grinde" wrote:


>>>>> On Tuesday, June 05, 2007 9:40 PM aneasiertomorro wrote:

>>>>> I'm sure I replied to this this morning but nothing's showing up...
>>>>>
>>>>> Hi Christopher
>>>>>
>>>>> You don't need VBA, just Custom Shows and a 'front page' slide with links to
>>>>> launch the one you need. See here for how to set them up:
>>>>> http://office.microsoft.com/en-us/powerpoint/CH063500731033.aspx
>>>>>
>>>>> If you need more info post back with which version you use.
>>>>>
>>>>> Lucy
>>>>> --
>>>>> MOS Master Instructor
>>>>> www.aneasiertomorrow.com.au
>>>>>
>>>>> If this post answered your question please let us know as others may be
>>>>> interested too
>>>>>
>>>>>
>>>>> "Christopher Grinde" wrote:


>>>>>> On Wednesday, June 06, 2007 12:08 AM pptheaven[AT]gmail[DOT]com wrote:

>>>>>> You can make use of custom shows to do that rather than VB.
>>>>>>
>>>>>> For instance, click Slide Show > Custom Shows. Click New. Set a new name for
>>>>>> custom show 1 (e.g. Short Version). Add the slides that you want to display
>>>>>> during slide show. Once you are done, click ok.
>>>>>>
>>>>>> Now, add a menu slide.
>>>>>> Add an action button that hyperlinks to the custom show 1.
>>>>>> Have it show and return.
>>>>>> Repeat the steps for medium and full version.
>>>>>> --
>>>>>> Shawn Toh (tohlz)
>>>>>> Microsoft MVP PowerPoint
>>>>>>
>>>>>> Site Updated: May 19, 2007
>>>>>> 9 new PowerPoint Artworks
>>>>>> http://pptheaven.mvps.org
>>>>>> PowerPoint Heaven - The Power to Animate
>>>>>>
>>>>>>
>>>>>> "Christopher Grinde" wrote:


>>>>>>> On Wednesday, June 06, 2007 1:08 PM RaeDrysdal wrote:

>>>>>>> Have you considered using custom shows? It sounds just right for what you
>>>>>>> want to do.
>>>>>>> --
>>>>>>> Rae Drysdale
>>>>>>>
>>>>>>>
>>>>>>> "Christopher Grinde" wrote:


>>>>>>>> On Wednesday, June 06, 2007 7:10 PM krave wrote:

>>>>>>>> Sorry not a detailed answer but if it was me, I'd head this way.
>>>>>>>>
>>>>>>>> Have Slide 1 as your Admin/Menu slide, say containing 2 buttons
>>>>>>>> Short/Med/Long which runs the macro then advances to first slide (i.e. next
>>>>>>>> slide)
>>>>>>>>
>>>>>>>> Sounds like you are planning to have fixed slides each time, so could
>>>>>>>> hardcode the slide numbers in an Array for each subset required.
>>>>>>>>
>>>>>>>> Then iterate through each slide checking against the array if false then
>>>>>>>> hide the slide.
>>>>>>>>
>>>>>>>> Probably best to reset (un-hide) all slides each time you run the pres.
>>>>>>>>
>>>>>>>> Easiest way to get a handle on where powerpoint hides things in its object
>>>>>>>> model is to record a macro manually. Then Alt-F11 and pick out the fragments
>>>>>>>> you want.
>>>>>>>>
>>>>>>>> Kyle.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> "Christopher Grinde" wrote:


>>>>>>>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>>>>>>>> Custom Favorites Web Site with MongoDb and NoRM
>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/7fbc7a01-5d30-4cd3-b373-51d4a0e1afa8/custom-favorites-web-site-with-mongodb-and-norm.aspx

Steve Rindsberg

unread,
Aug 21, 2010, 10:21:01 PM8/21/10
to
Instead of a named marker shape, you can simply "tag" the slides:

With ActiveWindow.Selection.SlideRange(1)
.Tags.Add "ShowFor", "Engineering"

Then:

For Each oSl in ActivePresentation.Slides
If oSl.Tags("ShowFor") = "Engineering" then
' do your stuff
End if
Next

0 new messages