use macro to change picture

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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/
 
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/~workspace/FileFetcher.cgi?Value=/home/workspace/ccalmr/hindc
asts/2002-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?

Good question. That's the first time this particular issue has come up here, but there've
been other similar instances like it with sounds, where there does appear to be a top
limit of 124 characters or so, so it's possible that there's some top limit here too.

Was the syntax of your shorter urls the same?




--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Yes, the sytax was the same, I pulled some random pictures off the internet just to test
that part of the code. One of the ones I used that worked was
http://lynx.uio.no/jon/gif/wwwnat/river.gif

Ah, but that's nothing like the other syntax -

http://cormorant.cse.ogi.edu/~workspace/FileFetcher.cgi?Value=/home/workspace/ccalmr/hindc
asts/2002-01-01/images/isosal_far_5/anim-sal_far_5.gif

One's a link directly to a GIF file, the other's a link to a CGI script that sends back a
gif file, or so it appears.

It may be that that's the problem rather than the path length.
PPT may not be parsing the URL correctly or it may simply not be able to link to a file
that doesn't really exist until a script serves it up.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Back
Top