Consulting

Results 1 to 2 of 2

Thread: Importing image on slide transition

  1. #1
    VBAX Newbie
    Joined
    Oct 2009
    Location
    Houston, TX
    Posts
    1
    Location

    Importing image on slide transition

    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:
    [vba]
    slide1.Image1.Picture=loadpicture("full path to picture")
    [/vba]

    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!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    The code you have is for an ActivX Forms2.Image control

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

    [vba]osld.Shapes.AddPicture FileName:="path", Left:=xx, Top:=xx, Width:=xx, Height:=xx[/vba]
    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.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •