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
"Des" wrote:
> .
>
> 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