PDA

View Full Version : Importing image on slide transition



Ward
10-06-2009, 05:56 PM
I am creating a non-linear PowerPoint in which I would like to add pictures when the user gets to specific slides. Since there is no way to know which order the slides will be accessed, it seems logical that the images need to be added dynamically using VBA. (Kind of like stacking books on top of each other. It would be wierd to have one hanging in space.)

I have never used VBA before. I just know it's there and it seems like it should be able to accomplish this. I came across the following code:

slide1.Image1.Picture=loadpicture("full path to picture")


I think one of the issues is that there is no button event to trigger the picture to load.

Follow up question...Is there a way to make an object persist across multiple frames? (Even when the user navigates backwards.)

Thanks!

John Wilson
10-08-2009, 03:27 AM
The code you have is for an ActivX Forms2.Image control

To add a normal image to a slide (assumes osld is a slide)

osld.Shapes.AddPicture FileName:="path", Left:=xx, Top:=xx, Width:=xx, Height:=xx
The problem though is getting the code to run on slide transition. Really you should use an event handler

http://www.pptfaq.com/FAQ00004.htm

There are "dirty" ways to code this but I wouldn't they are unreliable.