I 'm trying to format automatically all the videos in a PowerPoint presentation doing the following:
- Maximize the size of the video in the slide.
- Center the video in the slide.
- Playing the video in a continuous loop.
- Playing the video automatically when the slide starts.
The first 3 work fine, but the fourth does not.
Any idea what could be the problem?
Here is the code I'm using:
Sub formatVideos()
Dim miDiapositiva As Slide
Dim miForma As Shape
'ancho diapositiva
anchoDiapositiva = ActivePresentation.PageSetup.SlideWidth
altoDiapositiva = ActivePresentation.PageSetup.SlideHeight
' Itera a través de todas las diapositivas
For Each miDiapositiva In ActivePresentation.Slides
' Itera a través de todas las formas en la diapositiva actual
For Each miForma In miDiapositiva.Shapes
' Verifica si la forma es un objeto de video
If miForma.Type = msoMedia Then
miForma.AnimationSettings.Animate = msoTrue
' Cambia el tamaño del video (por ejemplo, 640x480 píxeles)
miForma.Width = anchoDiapositiva
miForma.Height = altoDiapositiva
' Centra
anchoVideo = miForma.Width
miForma.Left = 0
' Centra el video verticalmente
altoVideo = miForma.Height
miForma.Top = 0
'Playing continuously
miForma.AnimationSettings.PlaySettings.LoopUntilStopped = msoTrue
'starts automatically
miForma.AnimationSettings.PlaySettings.PlayOnEntry = msoTrue
End If
Next miForma
Next miDiapositiva
End Sub