Scroll bar in PowerPoint

T

Tom S

Hi everyone,

In PowerPoint, how do I link the scrollbar to buttons? For example, my
buttons won't fit on one slide, so I need to create a scroll bar which when
the user scrolls across, the other buttons appear.

How do I code this?

Thanks a lot,

Tom :)
 
T

Tom S

Hi,

Yeah, I was aware I needed to program in VB, I just need to know the code
for a scroll bar and buttons. :)

Thanks for your help,

Tom
 
B

Brian Reilly, MVP

You could accomplish this in a variety of ways.
Here's a simple way that is hard-coded to a shape named "Rectangle 6".
The macro is
With ActivePresentation.SlideShowWindow.View.Slide.Shapes("Rectangle
6")
If .Visible = True Then
.Visible = False
Else
.Visible = True
End If
End Withactivated by the mouse over event in Action settings.

Sorry for the word wrap here.

Brian Reilly, MVP
 
T

Tom S

Hi,

Thanks for the reply.

That doesn't get a scroll bar though? I really need a scroll bar and buttons
please.

Thanks a lot,

Tom :)
 
B

Brian Reilly, MVP

Tom, maybe I didn't understand your question. Care to elaborate more
on this scrollbar idea?

Brian Reilly, MVP
 
G

Guest

Hi again,

OK, basically, I need a scroll bar which when the user scrolls across, more
buttons appear. Like on this forum, I can scroll down and more text appears.
Like that, but with buttons. For example, button 1, button 2 and button 3 are
displayed, when I scroll across a bit, button 4, button 5 and button 6 appear.

Just your basic scroll bar with buttons please. :)

Thanks a lot,

Tom :)
 
B

Brian Reilly, MVP

Tom, I may be getting dumber and dumber by the day. I am sure I am.
But I just don't get what you want to do here.

Can you please re-write the description of what you want again. Maybe
you're use of the term "scroll bar" is throwing me off since it means
something very specific to the programmers here.

Anyone else want to explain what Tom wants or are you as confused as
me?

Brian Reilly, MVP

On Sun, 11 Nov 2007 06:15:00 -0800, Tom S <Tom
 
S

Steve Rindsberg

Hi everyone,

In PowerPoint, how do I link the scrollbar to buttons? For example, my
buttons won't fit on one slide, so I need to create a scroll bar which when
the user scrolls across, the other buttons appear.

Let me see if I'm picturing this right.

You have a slide with buttons on it. Lots of buttons, more than will fit on
the slide so some of them are off-screen when you view the presentation in
slideshow view.

You want a scrollbar on the slide so the user can scroll the buttons back and
forth, bringing the ones that were off-slide onto the slide and some of the
ones that were on the slide would scroll off.

Something like that?

You'd need to draw a scrollbar with the Scroll Bar control in the VB toolbox.

You'd then add code to the scrollbar's Change event (doubleclick the scrollbar
to go right to it).

The scrollbox's .Value property will tell you the position of the scrollbar's
"thumb":

MsgBox Me.Shapes("Scrollbar1").OLEFormat.Object.Value

By default, this is on a scale from 0 to 32767 but you can rightclick the
scrollbar, choose Properties and set the Max value to anything you like.

From there you'll need to do the math to work out which of the buttons need to
be moved left/right and by how much.

If the buttons are all of the same object type and are the only shapes of that
type on the slide, you can do this in a simple loop. If this is in the
scrollbar's change event:

Dim oSh as Shape
Dim Increment as Single
' calculate how much, neg or pos, to move the shapes and store it in Increment
Increment = 100 (arbitrarily)

For Each oSh in Me.Shapes
If oSh.Type = (whatevertype we're looking for) Then
oSh.Left = oSh.Left + Increment
End If
Next

Once you're done moving the shapes, you'll need to go to the slide in order to
refresh the view.

ActiveWindow.View.GotoSlide (Me.SlideIndex)

That should get you started, I think.
 

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