Linked images do not appear when the presentation and the images are moved to a new drive or folder in PowerPoint

Symptoms

After you move both a Microsoft PowerPoint presentation and pictures that are linked to that presentation to a new drive or to a folder location, the pictures are not visible. Instead, the pictures appear as placeholders. This problem occurs even though the pictures are in the same folder on the same drive where the presentation is located.

For example, you create a presentation that contains many linked images, and then you write it to a recordable CD (CD-R). When you open the presentation from the CD-R on another computer, the images do not appear in the presentation, even though they are on the CD-R.

Cause

This problem occurs because the folder that contains the pictures has been moved. PowerPoint uses an absolute path to locate the linked images. If the drive letter or path changes, the images do not appear. This problem may occur when a presentation that was created on drive C is written to the root directory of a CD-R, and then opened from the CD-ROM drive, typically drive D. Because the paths of the linked images start with C, the images are not found when the presentation is opened.

Workaround

To work around this problem, use either of the following methods.

Method 1: Use the "Package for CD" feature

Microsoft Office PowerPoint 2007 and Microsoft Office PowerPoint 2003 have a feature that is named "Package for CD". When you want to run a presentation on another computer, the "Package for CD" feature can put all the required files in one archive file.

If you have CD burning hardware, you can copy presentations to a blank recordable CD (CD-R), a blank rewritable CD (CD-RW), or a CD-RW that has existing content. However, existing content on the CD-RW will be overwritten.

You can also use the "Package for CD" feature to copy the presentation to a folder on your computer, a network location, or, if you do not include the viewer, a floppy disk instead of directly to a CD. You can then unpack the file on the destination computer or the network share and run the presentation.

When you package your presentation, linked files are included automatically, although you have the option to exclude them. You can also add other files to the presentation package. The "Package for CD" feature converts the absolute paths of the picture links to relative ones. That is, instead of the path being "C:\My Documents\My Pictures\image001.jpg", the path becomes"image001.jpg".

Packing a Presentation and Associated Files

To use the "Package for CD" feature on a presentation to run on another computer, follow these steps:
  1. Open the presentation that you want to package. If you are working with a new presentation that has not been saved previously, save the presentation.

    Note Before you give others a copy of the presentation, it is a good idea to review personal and hidden information, and decide if it is appropriate to include. You may want to remove comments, ink annotations, and markup before you package your presentation.
  2. Insert a CD into the CD drive.

    Notes
    • You will require one of the following types of CDs: a blank recordable CD (CD-R), a blank rewritable CD (CD-RW), or a CD-RW that has existing content that can be overwritten.
    • If you use a CD-R, make sure that you copy all the files that you want onto the CD the first time.

      After the files are copied, you cannot add more files to the CD.
  3. On the File menu, click Package for CD.
  4. In the Name the CD box, type a name for the CD.
  5. To specify the presentations to include and the play order, do any of the following:
    • To add more presentations or other files that are not included automatically, click Add Files. Select the files that you want to add, and then click Add.
    • By default, presentations are set up to run automatically in the order that they are listed in the Files to be copied list. To change the play order, select a presentation, and then click the UP ARROW or the DOWN ARROW to move it to a new position in the list.

      Note By default, the presentation that is currently open is already in the Files to be copied list. Files that are linked to the presentation, such as graphic files, are included automatically but do not appear in the Files to be copied list. Additionally, the Microsoft Office PowerPoint Viewer is included by default so that you can run the packaged presentation on a computer that does not have PowerPoint installed.
    • To remove a presentation, select the presentation, and then click Remove.
  6. To change the default settings, click
    Options, and then do any of the following:
    • To exclude the Viewer, click to clear the
      PowerPoint Viewer check box.
    • To prevent presentations from playing automatically or to specify a different automatic play option, select your preference from the
      Choose how presentations will play in the PowerPoint Viewer list.
    • To include TrueType fonts, click to select the
      Embedded TrueType fonts check box.
    • To require a password to open or edit all packaged presentations, under Secure the PowerPoint files, type the password that you want to use.
    • To close the Options dialog box, click
      OK.
  7. Click Copy to CD.

    Note You can use this procedure to package one or more presentations in a folder on your computer or a network location instead of onto a CD. Instead of clicking Copy to CD, click Copy to Folder, and then provide the folder information.

Method 2: Use a macro code to set a relative path

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Note The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

230746 PPT: Viewer: Presentation Macros Don't Run Within the Viewer


You can also use a macro to convert the links from absolute to relative. This permits PowerPoint to locate the pictures based on the presentation's current location, as long as the pictures are in this same location.

The following is a code sample that shows one way that this can be automated. This code sample assumes that the presentation and the linked pictures are in the same folder location. If they are not in the same folder location, running this code will break the link to the picture.

Sample Code

  1. On the Tools menu, point to
    Macro, and then click Security.
  2. Click Medium for the Security level, and then click OK.
  3. On the Tools menu, point to
    Macro, and then click Visual Basic Editor.
  4. On the Insert menu, click
    Module.
  5. Type the following code in the module:
    Sub RelPict()
    Dim oSlide As Slide
    Dim oShape As Shape
    Dim lPos As Long
    Dim strLink As String
    '
    ' Loop through the presentation and check each shape
    ' on each slide to determine whether it is a linked picture.
    '
    For Each oSlide In ActivePresentation.Slides
    For Each oShape In oSlide.Shapes
    If oShape.Type = msoLinkedPicture Then
    With oShape.LinkFormat
    '
    ' Search from the rightmost portion of the source
    ' file name and find the first backslash "\" character.
    '
    lPos = InStrRev(.SourceFullName, "\")
    '
    ' Determine whether the link was already modified.
    '
    If lPos <> Null Then
    '
    ' Determine how long the file name is by subtracting
    ' the position at which the "\" character was found from
    ' the total length of the source file name.
    '
    lPos = Len(.SourceFullName) - lPos
    '
    ' Extract the file name from the source file name, then
    ' assign the file name to the source file name. This procedure turns
    ' it into a relative path.
    '
    strLink = Right(.SourceFullName, lPos)
    .SourceFullName = strLink
    End If
    End With
    End If
    Next oShape
    Next oSlide
    End Sub

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Propriedades

ID do Artigo: 827115 - Última Revisão: 12 de set de 2011 - Revisão: 1

Comentários