Microsoft KB Archive/285317

= Linked images are not displayed when a PowerPoint presentation and images are moved to a new drive =

Article ID: 285317

Article Last Modified on 6/4/2007

-

APPLIES TO


 * Microsoft Office PowerPoint 2007
 * Microsoft Office PowerPoint 2003
 * Microsoft PowerPoint 2002 Standard Edition

-



This article was previously published under Q285317





SYMPTOMS
After you move both a Microsoft PowerPoint 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. Microsoft Office PowerPoint 2007, PowerPoint 2003, and PowerPoint 2002 use 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 &quot;Package for CD&quot; or &quot;Pack and Go&quot;
When you want to run a presentation on another computer, PowerPoint can create a package that puts all the required files into one folder or onto a CD. PowerPoint 2002 can put all the required files into a single archive file or span multiple disks. Then you unpack the PowerPoint 2002 Pack and Go file on the destination computer or network share and run the presentation.

When you package your presentation, you can decide to include all linked files in the presentation. When you do that, PowerPoint converts the absolute paths of the picture links to relative ones. That is, instead of the path being &quot;C:\My Documents\My Pictures\image001.jpg&quot;, the path becomes &quot;image001.jpg&quot;.

Packaging a presentation and associated files
PowerPoint 2007

To use the Package for CD feature of PowerPoint 2007, follow these steps:  Open the presentation that you want to package for CD. Click the Microsoft Office Button, point to Publish, and then click Package for CD. If you are prompted to confirm the conversion to earlier PowerPoint formats, click OK. By default, all linked files are included with the packaged presentation. Click Copy to Folder, or click Copy to CD.

If you clicked Copy to Folder, follow these steps:  Type a folder name in the Folder Name box, and then click Browse to locate a destination for this folder. Click Select, and then click OK.</li> Click Yes to include the linked files together with the presentation.</li></ol>

If you clicked Copy to CD, you must have a blank writable CD ready to insert into your CD or DVD disc drive. Click Retry. When PowerPoint finishes burning the CD, click No when you are prompted to burn another CD.</li> Click Close.</li></ol>

To start the presentation, you can insert the CD into a computer and then double-click the CD icon in Windows Explorer, or you can locate the folder that you created in step 4 and then open the presentation in PowerPoint 2007.

PowerPoint 2003

To use the Package for CD feature of PowerPoint 2003, follow these steps: <ol> Open the presentation that you want to package for CD.</li> Click Package for CD on the File menu.</li> By default, all linked files are included with the packaged presentation. Click Copy to Folder, or click Copy to CD.

If you clicked Copy to Folder, follow these steps: <ol style="list-style-type: lower-alpha;"> Type a folder name in the Folder Name box, and then click Browse to locate a destination for this folder.</li> Click Select, and then click OK.</li> Click Yes to include the linked files together with the presentation.</li></ol>

If you clicked Copy to CD, you must have a blank writable CD ready to insert into your CD or DVD disc drive. Click Retry. When PowerPoint finishes burning the CD, click No when you are prompted to burn another CD.</li> Click Close.</li></ol>

To start the presentation, you can insert the CD into a computer and then double-click the CD icon in Windows Explorer, or you can locate the folder that you created in step 4 and then open the presentation in PowerPoint 2007.

PowerPoint 2002

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.
 * 1) Choose to include Linked Files. At this point, you can choose to embed TrueType fonts with your presentation. Click Next.
 * 2) 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 PowerPoint 2002 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. 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. However, 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 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
<ol> Open the Visual Basic Editor:

PowerPoint 2007 <ol style="list-style-type: lower-alpha;"> Click the View tab.</li> Click Macros in the Macros group.</li> Type RelPict in the Macro name box, and then click Create.</li></ol>

PowerPoint 2003 and PowerPoint 2002 <ol style="list-style-type: lower-alpha;"> On the Tools menu, point to Macro, and then click Security.</li> Click Medium for the security level. Click OK.</li> <li>On the Tools menu, point to Macro, and then click Visual Basic Editor.</li> <li>On the Insert menu, click Module.</li></ol> </li> <li> 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 &quot;\&quot; character. '              lPos = InStrRev(.SourceFullName, &quot;\&quot;) '  ' 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 &quot;\&quot; 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 </li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: kbnoOfficeAlertID PPT2007 PPT2003 PPT2002 PPT

Keywords: kbbug kbnofix KB285317

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.