Two questions here.
1) How can I extract the lengths of audio time from each slide? There are 40 slides.
2) How can I use VBA to update each of the playbacks to start automatically?
Extract all recorded audio times from a ppt
-
- 3StarLounger
- Posts: 254
- Joined: 09 May 2020, 14:00
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Extract all recorded audio times from a ppt
1) See how to determine the length of an auto-running powerpoint presentation (with audio)? for both a VBA solution and a manual one.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Extract all recorded audio times from a ppt
Here is an extended version of the macro from the above link:
Code: Select all
Sub SoundMediaLength()
Dim sld As Slide
Dim shp As Shape
Dim total As Long
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoMedia Then
If shp.MediaType = ppMediaTypeSound Then
Debug.Print shp.MediaFormat.Length
total = total + shp.MediaFormat.Length
End If
End If
Next shp
Next sld
Debug.Print "Total: " & total
End Sub
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Extract all recorded audio times from a ppt
2) I don't know enough about PowerPoint VBA, sorry. I tried this, but it doesn't work for me:
I hope someone else knows. Otherwise, you might ask this in the PowerPoint forum on Microsoft Community
Code: Select all
Sub SoundMediaLength()
Dim sld As Slide
Dim shp As Shape
Dim eff As Effect
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.Type = msoMedia Then
If shp.MediaType = ppMediaTypeSound Then
'Set audio to play automatically
Set eff = sld.TimeLine.MainSequence.AddEffect _
(shp, msoAnimEffectMediaPlay, , msoAnimTriggerWithPrevious)
eff.EffectInformation.PlaySettings.HideWhileNotPlaying = True
End If
End If
Next shp
Next sld
End Sub
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 254
- Joined: 09 May 2020, 14:00
Re: Extract all recorded audio times from a ppt
Thanks Hans. I'll go to the PowerPoint forum on MS community and ask.