Hello, how do I count sound and video file on powerpoint presentation thanks. :wave:
Printable View
Hello, how do I count sound and video file on powerpoint presentation thanks. :wave:
Hi,Quote:
Originally Posted by Kawser
It will count the number of sound files and video file not gifs, pictures etc.VB Code:
Sub MediaCounter() Dim oSlide As Slide Dim oShape As Shape Dim intCounter As Integer intCounter = 0 For Each oSlide In ActivePresentation.Slides For Each oShape In oSlide.Shapes If oShape.Type = msoMedia Then intCounter = intCounter + 1 End If Next Next MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion MsgBox "There are " & intCounter & " Media object(s) in this presentation", vbQuestion End Sub
Quote:
Originally Posted by cssriraman
Hey thanks for your help, but that what I did at first it counts the shape of the sound and the video together, but what I want is it to count the sound and the video separately thanks. Sorry about that /|\ :thumb:
Hi,
Here is the code:VB Code:
Sub MediaCounter() Dim oSlide As Slide Dim oShape As Shape Dim intVideoCounter As Integer Dim intSoundCounter As Integer For Each oSlide In ActivePresentation.Slides For Each oShape In oSlide.Shapes If oShape.Type = msoMedia Then Select Case oShape.MediaType Case ppMediaTypeMovie intVideoCounter = intVideoCounter + 1 Case ppMediaTypeSound intSoundCounter = intSoundCounter + 1 End Select End If Next Next MsgBox "There are " & ActivePresentation.Slides.Count & " Slide(s) in this presentation", vbQuestion MsgBox "There are " & intVideoCounter & " Video object(s) in this presentation", vbQuestion MsgBox "There are " & intSoundCounter & " sound object(s) in this presentation", vbQuestion End Sub
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.