TPE

http://bayanbox.ir/view/263405954590585756/2mobile.png

Tavvafi@gmail.com


≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Sub EmbeddedMoviesToLinkedMovies()

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long
Dim sPath As String

' IMPORTANT
' Edit this to the path where your movie files are stored,
' Path must end in backslash
sPath = "C:\Stuff\MovieStuff\ThisProjectsMovieStuff\"

For Each oSl In ActivePresentation.Slides
    For x = oSl.Shapes.Count To 1 Step -1
        Set oSh = oSl.Shapes(x)
        If oSh.Type = msoMedia Then
            If oSh.MediaType = ppMediaTypeMovie Then
                If oSh.MediaFormat.IsEmbedded Then
                    Debug.Print oSh.Name
                    Call ConvertToLinked(oSh, sPath)
                End If
            End If
        End If
    Next    ' Shape
Next    ' Slide

End Sub

Sub ConvertToLinked(oSh As Shape, sPath As String)

Dim oSl As Slide
Dim oNewVid As Shape
Dim x As Long
Dim lZOrder As Long

Set oSl = oSh.Parent
lZOrder = oSh.ZOrderPosition

Set oNewVid = oSl.Shapes.AddMediaObject2(sPath & oSh.Name, _
    msoTrue, msoFalse, _
    oSh.Left, oSh.Top, _
    oSh.Width, oSh.Height)

Do Until oNewVid.ZOrderPosition = lZOrder
    oNewVid.ZOrder (msoSendBackward)
Loop

oSh.Delete
End Sub