none
Embed a video in Power Point 2007 c# RRS feed

  • Question

  • Hey Guys,

    I´m with a problem here, i´m developing a add-in for Power Point, and i need to add a video in a slide.

    I found a solution in internet, and it worked perfectly when i runned it in power point 2010. So a client installed it in a power point 2007, and it didn´t worked. It crashes when try to add the video in the slide. Actually it don´t crashes, it just stop working. All the code bellow doesn´t work, and it not thrown any exception.

    This is the code that i´m using:

         Microsoft.Office.Interop.PowerPoint.Shape newShape = curSlide.Shapes.AddMediaObject2(
                    FileName: path + @"\teste.avi",
                    LinkToFile: MsoTriState.msoFalse,
                    SaveWithDocument: MsoTriState.msoCTrue,
                    Left: 0,
                    Top: 0);
                    newShape.Height = 200;
                    newShape.Width = 200;


    it´s working fine in 2010, but not in 2007. Anyone know what is wrong?

    Monday, November 26, 2012 8:36 PM

Answers

All replies

  • Hi PabloBarros,

    Thanks for posting in the MSDN Forum.

    Would you please tell me whether it works fine on other computer which use Office 2007? It's based on my experience that what your description will not be reproduce at all. I think there must exist some option need we pay attention. If it can be reproduce at other computer please let me know, I will involve some experts into your thread.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 27, 2012 7:49 AM
    Moderator
  • Hello Tom!

    It worked sor far only in computers with office 2010. With office 2007 i tryied in three different computers and doesn´t work. I updated the code, to this one, but still not working: 

    Shape newShape = curSlide.Shapes.                  
                        AddMediaObject2(path + @"\teste.avi");
                    newShape.Height = 200;
                    newShape.Width = 200;


    Pablo Barros ------------- MSP

    Tuesday, November 27, 2012 12:19 PM
  • Hi PobloBarros,

    In PowerPoint 2007 there only exist AddMediaObject method, there doesn't have AddMediaObject2 method. Please double check it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, December 3, 2012 3:00 AM
    Moderator
  • Hi Tom,

    The problem is, with AddMediaObject method i just cand add an image, and i need to add a video. I tryied with AddMediaObject and it only add a static image on my slide, and with AddMediaObject2 i can add a video. Is there any method to add video to office 2007 ?


    Pablo Barros ------------- MSP

    Thursday, December 6, 2012 2:10 AM