none
Storing "Files" in Powerpoint RRS feed

  • Question

  • Hi all,

    I am attempting to store MP4, MP3, ZIP and SWF files into powerpoint so that later I can export data out of the powerpoint (long story, but think of something like a storyboarding/authoring tool). Anyways, I have gotten to the point where I have the filePath, then I try to do the following:

     

    PowerPoint.Slide currentSlide = Globals.ThisAddIn.Application.ActiveWindow.View.Slide;
    currentSlide.Shapes.AddMediaObject(this.filePath, 0, 0, -1, -1);
    

     

    I believe AddMediaObject is looking for a "compatible file type" like wmv, wma, etc. While they are viable formats, the end result won't be happy with those, and I rather not convert more than once. So the question is: Can I do one of the following: A) store files within powerpoint a different way, B) add an MP4, MP3 codec or Flash Player, or C) disable/ignore those warnings? 



    Saturday, January 21, 2012 3:08 AM

Answers

  • You should be able to do this and you need to use the correct object type.  I ran a little test using VBA in PPT 2010 and all of them worked.

        ppt.Slides(3).Shapes.AddMediaObject FileName:="C:\Users\Public\Music\Sample Music\Kalimba.mp3"
        ppt.Slides(3).Shapes.AddOLEObject FileName:="H:\George4ppt.zip"
        ppt.Slides(3).Shapes.AddOLEObject FileName:="H:\TK2010\CT & PS Leader Guide.swf"
    
    

    Hope this helps


    Kind Regards, Rich ... http://greatcirclelearning.com
    Saturday, January 21, 2012 12:08 PM

All replies

  • You'll probably get the fastest and most knowledgeable answer from the PowerPoint specialists. Oddly enough, these hang out on "Answers", rather than MSDN:

    http://answers.microsoft.com/en-us/office/forum/powerpoint


    Cindy Meister, VSTO/Word MVP
    Saturday, January 21, 2012 7:34 AM
    Moderator
  • You should be able to do this and you need to use the correct object type.  I ran a little test using VBA in PPT 2010 and all of them worked.

        ppt.Slides(3).Shapes.AddMediaObject FileName:="C:\Users\Public\Music\Sample Music\Kalimba.mp3"
        ppt.Slides(3).Shapes.AddOLEObject FileName:="H:\George4ppt.zip"
        ppt.Slides(3).Shapes.AddOLEObject FileName:="H:\TK2010\CT & PS Leader Guide.swf"
    
    

    Hope this helps


    Kind Regards, Rich ... http://greatcirclelearning.com
    Saturday, January 21, 2012 12:08 PM
  • This worked great :)
    Monday, January 23, 2012 10:18 PM
  • As a quick follow up, would you happen to know how to pull this data out after? Assume that I have found the shape that represents this OLEObject.

    Can I then do something like:
    shape.OLEformat.saveToFile(path+"something.zip");


      I mean it probably won't be that simple. I have been experimenting, but I can't figure out how to do that part.

     

    Thanks,
    Parris 

    Monday, January 23, 2012 11:18 PM