PDA

View Full Version : missing the boat somewhere



DBrenchley
11-16-2010, 09:57 PM
I have flash swf's embedded in ppt. The flash movies fail to rewind when the ppt is loaded .. trying to use the following code ..

Sub Rewind()
Dim obj As Object
Dim oSlide As Object
For Each oSlide In ActivePresentation.Slides
Debug.Print oSlide.Name
For Each obj In oSlide.Shapes
If InStr(obj.Name, "Flash") <> 0 Then
Debug.Print obj.Name
obj.Rewind
End If
Next obj
Next oSlide
End Sub

but at obj.rewind I get a runtime error "Object doesn't support this property or method" ..

THANKS for your assist !!!

John Wilson
11-17-2010, 12:50 AM
The shape is not the flash object

Try

Sub Rewind()
Dim oShape As Shape
Dim oSlide As Slide
Dim oFlash As Object
For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Name Like "*Flash*" Then
Set oFlash = oShape.OLEFormat.Object
oFlash.Rewind
End If
Next oShape
Next oSlide
End Sub

John Wilson
11-17-2010, 01:37 AM
Also you might want to add
oFlash.Playing=True