none
How to find audio, video and animation in word, excel and powerpoint documents. RRS feed

  • Question

  • Hi,

    How to find audio, video and animation in word, excel and powerpoint documents.

    Thanks in Advance,

    Johny

    Tuesday, September 4, 2012 5:15 AM

Answers

  • Hi Johny

    OK, I think I can at least get you started, although I don't really work with these things, myself. Note that since you specify PowerPoint in your last reply, that's what I'm going to show you. Every application will do things differently.

    The sample code is pseudocode, based on VBA. But it should be enough to get you going:

      PowerPoint.Presentation p = ppApp.ActivePresentation;
      foreach (PowerPoint.Slide s in p.Slides)
      {  
        foreach (PowerPoint.Shape shp in s.Shapes)
        {
             if (shp.Type==Office.MsoShapeType.msoMedia)
             {
                 switch (shp.MediaType) {
                     case (PowerPoint.PpMediaType.ppMediaTypeSound)
                     case (PowerPoint.PpMediaType.ppMediaTypeMovie) }
              }
         }
       }


    Cindy Meister, VSTO/Word MVP

    Thursday, September 6, 2012 2:47 PM
    Moderator

All replies

  • Which version of Office? How were these objects inserted?

    How things like this are stored depend very much on the version of the applications...


    Cindy Meister, VSTO/Word MVP

    Tuesday, September 4, 2012 9:16 AM
    Moderator
  •  

    Hi Cindy

    Versions of Office 2007 and 2010.

    I am opening documents like this way

    Microsoft.Office.Interop.Word.Application wordApp = null;

     Microsoft.Office.Interop.Word.Document wordDoc = null;

     wordApp = new Microsoft.Office.Interop.Word.Application();
     wordApp.Visible = false;
     wordDoc = wordApp.Documents.Open(filePath);

    Johny


    • Edited by pc.johny Wednesday, September 5, 2012 9:00 AM
    Wednesday, September 5, 2012 9:00 AM
  • Hi johny

    I asked how the audio, video and animation objects have been inserted into the Word documents. What commands were used?


    Cindy Meister, VSTO/Word MVP

    Wednesday, September 5, 2012 10:28 AM
    Moderator
  • Hi Cindy,

    I apologies for invalid information given.

    I required code for detect audio and video in powerpoint documents. But i don't know how to do this.

    Please help me on this.

    Johny

    Thursday, September 6, 2012 7:18 AM
  • Hi Johny

    OK, I think I can at least get you started, although I don't really work with these things, myself. Note that since you specify PowerPoint in your last reply, that's what I'm going to show you. Every application will do things differently.

    The sample code is pseudocode, based on VBA. But it should be enough to get you going:

      PowerPoint.Presentation p = ppApp.ActivePresentation;
      foreach (PowerPoint.Slide s in p.Slides)
      {  
        foreach (PowerPoint.Shape shp in s.Shapes)
        {
             if (shp.Type==Office.MsoShapeType.msoMedia)
             {
                 switch (shp.MediaType) {
                     case (PowerPoint.PpMediaType.ppMediaTypeSound)
                     case (PowerPoint.PpMediaType.ppMediaTypeMovie) }
              }
         }
       }


    Cindy Meister, VSTO/Word MVP

    Thursday, September 6, 2012 2:47 PM
    Moderator
  • Thank you Cindy.
    Friday, September 7, 2012 1:13 PM
  • Hi Cindy,

    I need one more help ,

    How can i check animation in powerpoint documents.

    I have tried like this way, which one is good.

    int count =slide.TimeLine.MainSequence.Count;

    or

    foreach(   Microsoft.Office.Interop.PowerPoint.Effect tr in slide.TimeLine.MainSequence)
                                    {

                                    } 

    Thanks in advance,

    Johny


    • Edited by pc.johny Monday, October 8, 2012 10:26 AM
    Monday, October 8, 2012 9:08 AM
  • Please post the new issue as a new question.

    Cindy Meister, VSTO/Word MVP, my blog

    Monday, October 8, 2012 2:25 PM
    Moderator