How to determine Audio file path and availability in PowerPoint 2010
I am duplicating with minor date changes, slideshows created by another user, who constantly forgets to embed audio, but links it instead.
Is there some simp开发者_JAVA百科le way to determine whether audio is embedded or linked, and what the source file path is, if it is linked? If I could run a macro to just determine this it would help enormously.
Not sure how to approach this, but individually opening dozens of files to determine audio is there defeats everything else that is scripted in this case.
This is the way I would do it:
Sub DetermineAudioLinks()
Dim p As Presentation: Set p = ActivePresentation
Dim s As Slide
Dim sh As Shape
For Each s In p.Slides
For Each sh In s.Shapes
If sh.Type = msoMedia Then
If sh.MediaType = ppMediaTypeSound Then
Debug.Print "Slide " & s.SlideNumber & ":" ; sh.Name
If sh.MediaFormat.IsLinked Then
Debug.Print vbTab & "Is Linked: True"
Debug.Print vbTab & sh.LinkFormat.SourceFullName
End If
End If
End If
Next
Next
End Sub
Note the the MediaFormat
property above is PowerPoint 2010 only - it won't work with earlier versions of PowerPoint.
精彩评论