Need help with scrollbar automation. I have not solved this yet.

U

ucsdgemini

Ok, Powerpoint Pros I need some help here. Here is the deal. I have a stack
of images layered on top of each other on a single slide. I have created a
custom animation that scrolls through these images when moving the wheel on
my mouse. In other words, it looks like an animation with the pictures
changing in a set order with me controlling it by going up or down the stack
with the scroll wheel. Make sense?

Now, what I want to do is insert a scroll bar that does this as well. The
reason I want this is that if I go to far with my mouse wheel, I actually
exit the slide which I don't want to do. I figured with a scroll bar I can
use that to go back and forth through the stacked images and remain on the
same slide.

However, I have no clue how to do this. Can anyone give me some code for
this as I am a VBA newbie. Thanks so much!
 
J

John Wilson

Assuming that your pics are called Picture 1, Picture 2, Picture 3 you could
set the upper and lower limit in properties and use code like this:

Private Sub ScrollBar1_Scroll()
Dim Ipic As Integer
Dim Iscrollval As Integer
Iscrollval = Me.ScrollBar1.Value
For Ipic = 1 To 3 'number of pics
If Ipic = Iscrollval Then
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Picture " &
CStr(Ipic)).Visible = True
Else
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Picture " &
CStr(Ipic)).Visible = False
End If
Next
End Sub
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
U

ucsdgemini

Thanks John, but it is not working. My pictures are named Capture0, Capture1
etc... I tried changing your wording to "Capture " but I am getting an
runtime error specified name not found. Also, how would I reinitiate the
scrollbar if I move on to the next slide and want to come back to the slide
with the stacked images and the scrollbar?
 

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