use macro to change picture

D

dgreer

2 things
When I write the macro and execute the macro from the vb editor to change one of the pictures in the slideshow, it works just fine. I made a button and had the button execute the macro from inside the show, everytime my macro stops on the line that would change the picture. It stops at this line
With ActiveWindow.Selection.ShapeRange is there some other line I am suppose to use that works for inside of the slideshow?

Secondly, I run a query on my database, which in turn gives me a webaddress for the desired .gif. When I was writing the macro earlier, I had a shorter url and it worked just fine, but now I have a quite long url, it is http://cormorant.cse.ogi.edu/~works...-01-01/images/isosal_far_5/anim-sal_far_5.gif
the line I am using to edit the shape is
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 5").Select
With ActiveWindow.Selection.ShapeRange
.Fill.UserPicture url
End With
where url is equal to the picture.
Is there a limit to how long the address can be? can it be changed somehow?
 
D

David M. Marcovitz

I'll try to answer your first question. When you run a macro in Slide Show View, you cannot select a shape so when you are trying to use ActiveWindow.Selection, it won't work. This is a problem with recording macros and trying to run them in Slide Show View. Instead, try

With ActivePresentation.SlideShowWindow.View.Slide.Shape(num)

where num is the number of the shape (that is your picture). This does something with a particular shape on the current slide.

--David

David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 

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