New to powerpoint 2007. How to use macros to move picture.

D

Des

Hi. I am not very good at ppt but can someone tell me if there is an
effect to re-size an image. What I would like to do is have a page
that shrinks the image to the top left corner and then displays text.
I know there are lots of special effects for images.I want the top
corner
of the image fixed so that the image retreates up and right.

I have been asking this question for over a week now. A reply takes a
day.
I have a presentation ChildrensTalk.pptm
On Slide 8 I have a jpg file called WaterWine.jpg

Sub Test()
Dim oSh As Shape
' Create a variable to hold a reference
' to a shape object


Set oSh = ActivePresentation.Slides(8).Shapes("WaterWine.jpg")
' create the reference to a specific shape
' You'd want to change shapename to whatever the name of your
' picture shape is. The filename isn't relevant.

End Sub

What is this stupid shape. I also need to know how to run this code
when I get to slide 8
 
G

Gary in AZ

I use this effect a lot and you can do it by using animation alone. Paste the
picture full size on the slide. Use custom animation and select Exit and pick
Faded Zoom. Now select the same picture and go to Motion Paths and select
Line. Draw a line to the upper right-hand corner of the slide. (You may have
to adjust the line after you watch it play so it will land in the right spot)
Make sure to toggle the motion path to With Previous. Now the picture will
shrink and fade as it moves to the upper left hand corner. Next step: Copy
the picture and paste it back on the slide. Resize it to the smaller size you
want and put it in the upper left hand corner where the faded version landed
when it faded out. Now animate the small picture by selecting Entrance and
picking Fade. Change the prompt to With Previous. You can not use the Advance
Timeline to adjust the timing so that the small picture will fade in just as
the big picture fades out. I hope this helps.
 
D

David Marcovitz

Hi. I am not very good at ppt but can someone tell me if there is an
effect to re-size an image. What I would like to do is have a page
that shrinks the image to the top left corner and then displays text.
I know there are lots of special effects for images.I want the top
corner
of the image fixed so that the image retreates up and right.

I have been asking this question for over a week now. A reply takes a
day.
I have a presentation ChildrensTalk.pptm
On Slide 8 I have a jpg file called WaterWine.jpg

Sub Test()
As Gary said, what you describe can probably be done without VBA. Unless
your using VBA for something else, you probably want to avoid using it for
this if it can be done with regular animations. If you really want to use
VBA for this...

The key here is to get oSh to actually be a reference to the shape in
question. The easiest way to do this is to give the shape a name. If you got
to Example 8.7 on my Web site (http://www.PowerfulPowerPoint.com/), there is
code to help you name the shape (you name the shape by selecting the shape
in Normal view and running the macro in 8.7 to name the shape).

Once you have the shape named, you will need to write your own macro to do
whatever it is that you want to do, such as:

Sub MoveAndGrow()
Dim oSh As Shape

Set oSh = ActivePresentation.Slides(8).Shapes("THE NAME")
'replace THE NAME with whatever you named the shape

oSh.Top = 0 'move to the top
oShp.Left = 0 'move to the left
oShp.Width = 50 'make smaller
End Sub

Once you write this macro (adjusting as you need), you can assign it to a
button. When you click on the button, you the shape should shrink and move.
Note that this is air code--i.e., I just wrote it off the top of my head--so
it might not work perfectly without some tweaking.

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

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