How to display the filenames of included picture-files?

M

Michael Moser

Hi, I have a stupid problem:

I have a document that included several picture-files, "includes"
meaning that these file were "hot-linked", i.e. with a reference to
the original file, such that when the file's content changed the
document would be updated automagically.

However, now these files have been moved and renamed and now PPT
displays just an empty rectangle instead of the file's content. I
wanted to go and clean up the mess, i.e. correct and replace the old
file references with the new, renamed ones, so that they point to the
right file locations again, but nowhere can I make these references to
show up, yet alone, edit them.

Is there some view, that allows to see the old filenames and edit
them? I would HATE to have to import all these images again (since
there was quite some size-adjustment and other detail fiddling
involved, which would all be lost, if I delete the old and re-do the
include).

Michael
 
T

Tim Hards

Hi Michael,
The following macro will let you view and change the filename of the picture
that a shape is linked to. To use it, select a shape, run the macro, then
type in a new filename if you want to change it. If you're not sure about
using macros, check the link at the end.


Sub ChangePictureLink()
Dim Shape As Shape
Dim Filename As String

If ActiveWindow.Selection.Type <> ppSelectionShapes Then
MsgBox "Please select a shape"
ElseIf ActiveWindow.Selection.ShapeRange.Count <> 1 Then
MsgBox "Please select only 1 shape"
Else
Set Shape = ActiveWindow.Selection.ShapeRange(1)
If Shape.Type <> msoLinkedPicture Then
MsgBox "The shape is not a linked picture"
Else

' Show the filename, and get a new one (if required)
Filename = InputBox("Filename of linked item:", "",
Shape.LinkFormat.SourceFullName)

' Change the filename
Shape.LinkFormat.SourceFullName = Filename

End If
End If
End Sub


Useful link:
http://www.rdpslides.com/pptfaq/FAQ00033.htm - how to use macro (VBA) code
 
S

Steve Rindsberg, PPTMVP

Michael Moser said:
Hi, I have a stupid problem:

No, PowerPoint has the problem. You have the toothmarks. ;-)

In addition to Tim's suggestion, try our FixLinks demo at
http://www.pptools.com
The free demo fixes links to image files and converts them to relative links
so that they won't break in the future, so long as the linked images and the
PPT file stay together in the same folder.
 
G

Gina

Michael-
I'm having the same issue!! I tried to install Tim's macro
but it choked on the following line:

Filename = InputBox("Filename of linked item:", "",
Shape.LinkFormat.SourceFullName)

did the same thing happen to you?.... Tim.. if you are
reading can you give a non-vba guru some help???

Thanks!!
Gina
 
T

Tim Hards

I have just realised that in my reply (copied below), I should have been
more careful with the line of code that stretches over two lines. For the
code to work, change these lines:

Filename = InputBox("Filename of linked item:", "",
Shape.LinkFormat.SourceFullName)

to:
Filename = InputBox("Filename of linked item:", "", _
Shape.LinkFormat.SourceFullName)

Sorry for any confusion!
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top