Show/Hide Slides in Powerpoint using VBA

R

Richard Smith

Hi,

I am a IT trainer who trains candidates on bespoke software. No 2 training
courses are ever the same and as such, I seem to be spending more and more
time, cutting and pasting multiple slideshows into one. I have been told that
it is possible to have a selection form that could be run at the start of the
slideshow, which contains a checkbox for each of the modules. I was hoping
that with a bit of simple code I would be able to filter which slides are
shown (maybe with a collection of IF Statements?)

e.g.

Using the Click/Update procedure of a form object

if CHKSoftwareA is 0 then (Show slides 1-15)
else
Show slides 16-30
end if

I have worked out how to test whether or not a checkbox is checked

So now I presume I need the following things

1. Code to show/hide one (or multiple slides)
2. A go button, that will then apply the changes and launch the slideshow.

I have done much research and it seems as though most people suggest to go
with a CustomSlideShow, however this could still prove to be a time consuming
exercise, which is why I have decided to give the VBA option a try. I have
also noticed that this question has been raised on a number of occasions, so
I presume this would benefit many people in a similar position to myself

I would appreciate it if someone could give me a few pointers on this

Here's hoping

Richard
 
J

John Wilson

Here's some code which would hide slides 1 - 6. To unhide you would just need
to use .Hidden = msofalse. Hope that helps you on your way. The very basic
error handler just jumps you out of the code if eg there aren't six slides.

Sub hideme()
Dim x As Integer
On Error GoTo errhandler
For x = 1 To 6
ActivePresentation.Slides(x).SlideShowTransition.Hidden = msoTrue
Next x
Exit Sub
errhandler:
End Sub
 

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