Convert embedded movies to linked movies
Problem
When you insert movies into PowerPoint 2010 and later, PowerPoint embeds them unless you specifically choose to link the movies. Earlier versions always linked movies, leaving them in external files.
This can present two problems:
- PowerPoint files with embedded movies become very large. They may be too large to email. If the same presentation used linked movies, you might be able to send the presentation in one email and individual movies as separate emails in order to get around email size limitations.
- Other than PowerPoint 2007 with SP2, earlier versions of PowerPoint can't even play embedded movies. Saving as an earlier format doesn't help: when you save from later versions as a PowerPoint 97-2003 format file, movies are converted to pictures.
Solution
While embedded movies are generally A Good Thing, there are still times when linked movies are An Even Better Thing.
Once you have a presentation with embedded movies, how do you convert them to linked movies though?
You can do it manually, of course. Delete each embedded movie, then re-insert the same movie, this time choosing the option to link (click the down-arrow on the Insert button instead of just clicking Insert).
For one or two movies, this is probably the simplest way to do the job, but if you've got lots of presentations to process or presentations with lots of movies, doing it manually could be VERY tedious.
So instead, we'll go at it with VBA code. If you can move all of the needed movie files into the same folder as the PPT itself, this VBA will replace the embedded movies with linked ones.
Be sure to edit the path as directed in the comments, else it won't work, and PLEASE work on a copy of your original file.
And you might want to run a few quick experiments on putting the movies in the same folder as a test presentation and setting the path to "". That might just give you pathless links, which'll work pretty much anywhere, so long as the movies and PPT/PPTX files stay in the same folder together.
Here's the code:
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