Forum Discussion
Edit/Mass Edit Powerpoint linked file addresses
Okay so I found something that can get me partially there on another forum after I posted this. Although I've worked with powerpoint a decent amount I'm not quite to the level of writing my own macros yet. This is the macro I found.
Sub EditLink()
' Edit links of some types
' Little error checking. It works or not. No harm if not.
Dim sLinkSource As String
Dim sOriginalLinkSource As String
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then
MsgBox ("Please select one and only one shape, then try again.")
Exit Sub
End If
With ActiveWindow.Selection.ShapeRange(1)
'MsgBox .LinkFormat.SourceFullName
sOriginalLinkSource = .LinkFormat.SourceFullName
sLinkSource = InputBox("Edit the link", "Link Editor", sOriginalLinkSource)
If sLinkSource = sOriginalLinkSource Then
' nothing changed; our work on this planet is done
Exit Sub
End If
If sLinkSource = "" Then
' The user canceled; quit:
Exit Sub
End If
' Get the filename portion of the link in case it's a link to a range
Debug.Print Mid$(sLinkSource, 1, InStr(sLinkSource, ".") + 3)
' Is it a valid filename? Is the file where it belongs?
' Test against the filename portion of the link in case the link includes
' range information
If Dir$(Mid$(sLinkSource, 1, InStr(sLinkSource, ".") + 3)) <> "" Then
.LinkFormat.SourceFullName = sLinkSource
.LinkFormat.Update
Else
MsgBox "Can't find " & sLinkSource
End If
End With
End SubThe good thing is for updating singular photos for my tables this will work perfectly should I ever need to update something in the future. For just a few items it's perfect. However efficiency wise it leaves much to be desired.
In addition I also found a macro on this page here:
https://www.rdpslides.com/pptfaq/FAQ00759_Search_-_Replace_to_change_OLE_link_paths.htm
However when I tried to do it, either something I was doing wasn't working, or the thing just flat out doesn't work for what I was wanting to do.
So my question now is this. Is there anything similar to the first macro that can work and let me mass edit file paths at once? For that matter if we could do a find and replace function on the "Edit Links to Files" table instead of having to change everything one by one, that would work too. For those of you who are much more experienced with powerpoint and macros than I am, what am I missing and how can I get over the finish line? The first macro I know for certain will work but is only good for a single thing at a time. Second one I couldn't get to work at all. Slight progress made.