Microsoft KB Archive/827115

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

Article ID: 827115

Article Last Modified on 6/6/2007

-

APPLIES TO


 * Microsoft Office PowerPoint 2007
 * Microsoft Office PowerPoint 2003

-





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 &quot;Package for CD&quot; feature
Microsoft Office PowerPoint 2007 and Microsoft Office PowerPoint 2003 have a feature that is named &quot;Package for CD&quot;. When you want to run a presentation on another computer, the &quot;Package for CD&quot; 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 &quot;Package for CD&quot; 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 &quot;Package for CD&quot; feature 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;.

Packing a Presentation and Associated Files
To use the &quot;Package for CD&quot; 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.
 * 1) Insert a CD into the CD drive.

Notes
 * 1) * 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.
 * 2) * 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.
 * 1) On the File menu, click Package for CD.
 * 2) In the Name the CD box, type a name for the CD.
 * 3) To specify the presentations to include and the play order, do any of the following:
 * 4) * 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.
 * 5) * 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.
 * 1) * To remove a presentation, select the presentation, and then click Remove.
 * 2) To change the default settings, click Options, and then do any of the following:
 * 3) * To exclude the Viewer, click to clear the PowerPoint Viewer check box.
 * 4) * 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.
 * 5) * To include TrueType fonts, click to select the Embedded TrueType fonts check box.
 * 6) * To require a password to open or edit all packaged presentations, under Secure the PowerPoint files, type the password that you want to use.
 * 7) * To close the Options dialog box, click OK.
 * 8) 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
 On the Tools menu, point to Macro, and then click Security. Click Medium for the Security level, and then click OK. On the Tools menu, point to Macro, and then click Visual Basic Editor. On the Insert menu, click Module.  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 &quot;\&quot; character. '              lPos = InStrRev(.SourceFullName, &quot;\&quot;) '  ' 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 &quot;\&quot; 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 

<div class="status_section">

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

Additional query words: PPT PPT2003 PPT2007

Keywords: kbmacro kbdisplay kbprb kbnofix KB827115

-

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

© Microsoft Corporation. All rights reserved.