PPT2002: Linked Images Are Not Displayed When Presentation and Images Are Moved to New Drive (285317)



The information in this article applies to:

  • Microsoft PowerPoint 2002

This article was previously published under Q285317

SYMPTOMS

After you move both a PowerPoint 2002 presentation and pictures that are linked to that presentation to a new drive or folder location, the pictures are not visible. Instead, the pictures are displayed as placeholders, 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 compact disc (CD-R). When you open the presentation from the CD-R on another computer, the images are not displayed in the presentation, even though they are on the CD-R.

CAUSE

The folder containing 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 can happen 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 to the linked images begin 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 Pack and Go

PowerPoint 2002 has a feature called Pack and Go. When you want to run a presentation on another computer, the Pack and Go Wizard can put all the required files into one archive file or span multiple disks. You then unpack the file on the destination computer or network share and run the presentation.

When you use Pack and Go on your presentation, you can choose to include all linked files in the presentation. When you do that, the Pack and Go Wizard coverts 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 Pack and Go on a presentation to run on another computer, follow these steps:
  1. Open the presentation that you want to pack.
  2. On the File menu, click Pack and Go.
  3. Follow the instructions in the Pack and Go Wizard.

    When prompted for which drive to copy to, click Select destination and browse to a temporary file location. This is where you pack your presentation and its associated files. Click Next.
  4. Choose to include Linked Files. At this point, you can choose to embed TrueType fonts with your presentation. Click Next.
  5. Do not include the viewer. Click Next, and then click Finish.
You can then copy the packed file and the Pngsetup.exe program to any drive or network share that you choose.

Unpacking a Presentation

To view your presentation, you must go to the location you copied the pack file to and unpack it. To do this, follow these steps:
  1. In Microsoft Windows Explorer, navigate to the location of the packed presentation, and then double-click Pngsetup.
  2. Enter the location where you want to unpack the file to.
  3. Click OK.
The presentation and the linked pictures will be unpacked in the location you chose.

Using Macro Code to Set Relative Path

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
NOTE: The following macro examples work only in PowerPoint. Visual Basic for Applications macros are not supported by the Microsoft PowerPoint Viewer. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
You can also use a macro to convert the links from absolute to relative. This will allow 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, showing one way in which this could 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, then 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. 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 checking each shape
       ' on each slide to see if 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 right hand portion of the source
       ' filename and find the first backslash "\" character.
       '
                   lPos = InStrRev(.SourceFullName, "\")
       '
       ' Check to see if the link has already been modified.
       '
                   If lPos <> Null Then
       '
       ' Determine how long the filename is, by subtracting
       ' the position the "\" character was found at from
       ' the total length of the source file name.
       '
                      lPos = Len(.SourceFullName) - lPos
       '
       ' Extract the filename from the source file name, then
       ' assign the filename to the source file name, turning
       ' 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 at the beginning of this article.

REFERENCES

For more information about packaging your presentations, click Microsoft PowerPoint Help on the Help menu, type Package a presentation to run on another computer in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:5/13/2002
Keywords:kbbug KB285317