This seems to work but I've only run it against one file.
Public Sub FixFileLinks()
Dim Logger As Integer
Logger = FreeFile
Open "Logger.txt" For Append As Logger
Dim SL As Slide
Dim SlideCount As Integer
Dim LinkCount As Integer
Dim LinksFixed As Integer
SlideCount = 0
LinkCount = 0
LinksFixed = 0
For Each SL In ActivePresentation.Slides
Dim SP As Shape
For Each SP In SL.Shapes
If (SP.Type = msoLinkedPicture) Then
LinkCount = LinkCount + 1
With SP
If InStr(1, .LinkFormat.SourceFullName, " ") > 0 Then
LinksFixed = LinksFixed + 1
Dim NewName As String
Dim OldName As String
OldName = .LinkFormat.SourceFullName
NewName = .LinkFormat.SourceFullName
NewName = Replace(NewName, " ", "_", 1)
Write #Logger, " OldName " & OldName
Write #Logger, " NewName " & NewName
Write #Logger, " ========="
Name OldName As NewName
.LinkFormat.SourceFullName = NewName
End If
End With
End If
Next SP
SlideCount = SlideCount + 1
Next SL
Write #Logger, " Slide count " & SlideCount
Write #Logger, " Link Count " & LinkCount
Write #Logger, " Links Fixed " & LinksFixed
Close Logfile
End Sub