scrollbar macro in powerpoint 2007

G

Guest

so im using powerpoint 2007, and i want to use the scrollbar macro that
powerpoint provides for us; but wen i put it in, it does nothing; wat's the
correct way to use this scroll bar macro? also, i've set up action buttons,
wen clicked upon, that makes things move left and rite using motion paths;
however, it doesn't work out like a scroll bar, cuz i have to put in a
starting position for it to start; so it is flawed, and tht's y im using the
scroll bar macro
 
S

Steve Rindsberg

Karatemyth said:
so im using powerpoint 2007, and i want to use the scrollbar macro that
powerpoint provides for us; but wen i put it in, it does nothing; wat's the
correct way to use this scroll bar macro? also, i've set up action buttons,
wen clicked upon, that makes things move left and rite using motion paths;
however, it doesn't work out like a scroll bar, cuz i have to put in a
starting position for it to start; so it is flawed, and tht's y im using the
scroll bar macro

What scroll bar macro are you referring to?
Where'd you find it?
 
G

Guest

sry i dint even see ur reply
im talking bout the developer tab in microsoft powerpoint 2007
they give some objects to insert into the slide
these objects are the macros
when i put my mouse over the button, it tells me it says scrollbar macro
(activexcontrol)
 
S

Steve Rindsberg

Ah, that. The scrollbar control.

None of the controls from the control toolbox do anything unless you write code to
make them do it. What do you want it to do?
 
G

Guest

well i want to have objects move left and rite when i press those buttons
currently i have set up motion paths whose triggers are the left and rite
buttons
basically i want to have objects move left when i press left and objects
move rite wen i move rite
the problem i have wit the motion paths is that their in order; so when u
press rite, it moves rite, but wen u press left rite after that, it moves
left from a different position; in order for it to go smoothly wit the motion
paths, i have to press rite four times, then i can press left to make it look
smooth and normal when it moves
 
S

Steve Rindsberg

Something like this might do it:
(watch for line breaks)

Private Sub ScrollBar1_Change()
Static LastValue As Single
Dim IncrementAmount As Single

IncrementAmount = 10 ' but change it to whatever you like

Select Case Me.ScrollBar1.Value
Case Is > LastValue
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (IncrementAmount)
Case Is < LastValue
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (-IncrementAmount)
End Select

' and remember the current value for future comparisons
LastValue = Me.ScrollBar1.Value

End Sub
 
G

Guest

ill try it out
but again, im not good wit vba

Steve Rindsberg said:
Something like this might do it:
(watch for line breaks)

Private Sub ScrollBar1_Change()
Static LastValue As Single
Dim IncrementAmount As Single

IncrementAmount = 10 ' but change it to whatever you like

Select Case Me.ScrollBar1.Value
Case Is > LastValue
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (IncrementAmount)
Case Is < LastValue
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (-IncrementAmount)
End Select

' and remember the current value for future comparisons
LastValue = Me.ScrollBar1.Value

End Sub






-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
G

Guest

i want textboxes to moves left and rite wen i click left and rite
so i tried entering textbox 1 where rectangle 1 was, and it dint work
is it supposed to work? then it couldve been a typo on my part
unless there is another code for moving textboxes
also, can u use that same code but for a different object?
say if i designed my own button, can i make it do just that?
 
G

Guest

meaning that i want to substitute the scrollbar for an object that i designed
myself
 
S

Steve Rindsberg

You mention also that you want this to happen with objects that you've created, rather than with a
scrollbar. That's not the same problem, so of course the answer won't work.

Suppose we start over ... please describe exactly what you want to do here.
Normal spelling and punctuation would be helpful too. VBA won't let you use shorthand; may as well
get into practice by avoiding it here too. Easier to understand.

Thanks.
 
G

Guest

Good Idea.
Alright, So I have one long rectangle and objects above and below it. As I
click left, the objects and rectangle should move left and vice versa. I have
the long rectangle increase in size and change positions as effects at the
beginning of the slide. Then the other objects around the long rectangle zoom
in. As the same time all this zooms in, the Left and Right control buttons
zoom in. After all this, I want to move all these object left and right from
the position the effects place them in. Alright, I think I got everything. Is
there anything you still want me to clear up?
 
S

Steve Rindsberg

Good Idea.
Alright, So I have one long rectangle and objects above and below it. As I
click left, the objects and rectangle should move left and vice versa. I have
the long rectangle increase in size and change positions as effects at the
beginning of the slide. Then the other objects around the long rectangle zoom
in. As the same time all this zooms in, the Left and Right control buttons
zoom in. After all this, I want to move all these object left and right from
the position the effects place them in. Alright, I think I got everything. Is
there anything you still want me to clear up?

OK, the animation stuff isn't relevant to the VBA, is it?
Hey, I asked for thorough, you gave me thorough ... I'm not complaining! <g>

For starters, you'll want to make two rectangles rather than one, if you want to distinguish between
clicks on one side and the other.

Let's call the left one Decrease and the right one Increase

Add this macro to your project and make the Increase rectangle's action setting Run Macro: Increase

Sub Increase()
Dim IncrementAmount as Single
IncrementAmount = 10 ' but change it to what you want
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (IncrementAmount)
End Sub

Do the same with the decrease rectangle only make it run this

Sub Decrease()
Dim IncrementAmount as Single
IncrementAmount = 10 ' but change it to what you want
ActivePresentation.Slides(1).Shapes("Rectangle 3").IncrementLeft (-IncrementAmount)
End Sub

In both of the above:
Change the .Slides(1) to .Slides(x) where x = the number of the slide this all happens on.
Change "Rectangle 3" to whatever the name of the shape is.
To move more shapes, duplicate the same line and change the name of the shape as needed.
 

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