Macro to select groups of slides in a PPT??

R

rickrcomm

Since I wow'd my work group with the last tip I got here (from John Wilson),
they have said what they would like is to have a menu of different groups of
slides and be able to fill in check boxes for group names and then show just
those slides. E.g., if I am a realtor, and I get a client who wants to see
houses in suburb alpha, bravo, but not charlie or delta, I would like to have
alpha, bravo, charlie and delta point to groups of slides, and if alpha and
bravo are selected in a checkbox, just slides in those two groups will be
shown.

Is that beyond the scope of this group?

Thanks,

Rick
 
D

David Marcovitz

Since I wow'd my work group with the last tip I got here (from John Wilson),
they have said what they would like is to have a menu of different groups of
slides and be able to fill in check boxes for group names and then show just
those slides. E.g., if I am a realtor, and I get a client who wants to see
houses in suburb alpha, bravo, but not charlie or delta, I would like to have
alpha, bravo, charlie and delta point to groups of slides, and if alpha and
bravo are selected in a checkbox, just slides in those two groups will be
shown.

Is that beyond the scope of this group?

Thanks,

Rick

To answer your last question, no, nothing is beyond the scope of this group.
If it can be done in PowerPoint, chances are that someone in this group can
tell you how to do it.

Now, to your specific question...it seems like you have two options:

(1) You can set up custom shows. This is not as simple as the check box
option, but it allows you to decide exactly which slides you want to show.

(2) If you really want a checkbox option, I'm afraid that is going to
require some VBA, and that will open a whole can of worms. That is, it is
doable, but it is difficult, and it might not be as portable as you would
like (e.g., it won't work in the free Viewer or a browswer).

--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
D

David Marcovitz

To answer your last question, no, nothing is beyond the scope of this group.
If it can be done in PowerPoint, chances are that someone in this group can
tell you how to do it.

Now, to your specific question...it seems like you have two options:

(1) You can set up custom shows. This is not as simple as the check box
option, but it allows you to decide exactly which slides you want to show.

(2) If you really want a checkbox option, I'm afraid that is going to
require some VBA, and that will open a whole can of worms. That is, it is
doable, but it is difficult, and it might not be as portable as you would
like (e.g., it won't work in the free Viewer or a browswer).

--David

Of course, I should have read more carefully. You are in search of a macro
so VBA is on the table. Unfortunately, this isn't as easy as your last
question (I have been reading in reverse chronological order so I just got
to the last one that John answered for you quite nicely.

I'm thinking that you might want to set up your check boxes (or other
buttons) to unhide the appropriate slides. That will be easier than trying
to create links to the appropriate slides. I would start with a button on
the first slide that does something like (all code below is untested so it
is sure to contain one or two errors):

Sub GetStarted()
Dim i As Long
'Hide all but the first 3 slides
For i = 3 to ActivePresentation.Sides.Count
ActivePresentation.Slides(i).SlideShowTransition.Hidden=True
Next i
ActivePresentation.SlideShowWindow.View.Next 'go to next slide
End Sub

Then, each button or check box would simply unhide each of the slides with
its own macro like:

Sub UnHide3()
ActivePresentation.Slides(3).SlideShowTransition.Hidden=False
End Sub

You might want the Sub to toggle the setting instead of change it to False:

Sub UnHide3()
ActivePresentation.Slides(3).SlideShowTransition.Hidden= _
Not ActivePresentation.Slides(3).SlideShowTransition.Hidden
End Sub

Or, if it is a check box, you might want to set the value of hidden based on
whatever the check box is set to. The basic idea isn't that hard, but to
make a really nice interface could take a good bit of work. At least, this
should get you started.

--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
E

Edward

If it was my project I would create several chapters (Title slides- one for
each group) and either tag those slides in VBA or use the title text and read
them in VBA to differentiate between different groups , Also you need a
userform with checkboxes that represent each group , now based on user’s
selection you can hide or unhide different groups (e.g hide all slides in
“bravo†group†starting at slide 17 and ending in slide 25, etc…)
It's a fairly simple logic if you are familiar with VBA and it won't take
more than 10 lines of code.
 
D

David Marcovitz

If it was my project I would create several chapters (Title slides- one for
each group) and either tag those slides in VBA or use the title text and read
them in VBA to differentiate between different groups , Also you need a
userform with checkboxes that represent each group , now based on user¹s
selection you can hide or unhide different groups (e.g hide all slides in
³bravo² group² starting at slide 17 and ending in slide 25, etcŠ)
It's a fairly simple logic if you are familiar with VBA and it won't take
more than 10 lines of code.

That's what happens when I read and respond too quickly. I missed the whole
thing about groups. The same thing I said applies (just with multiple slides
in each Hide and Unhide procedure. As Edward says, it might be simplest to
apply tags to the slides so you can cycle through the slides and hide or
unhide everything with an Alpha or Bravo tag.

--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
L

Lucy Thomson

I would still run with custom shows for this. Why involve code if you don't
need it? But then you know me, gui girl through and through ;-)

Lucy

--
Lucy Thomson
PowerPoint MVP
MOS Master Instructor
www.aneasiertomorrow.com.au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top