1

I have several PPTX presentations that contain linked videos (not embedded because of file size). The presentations themselves are stored in OneDrive as well as the videos.

However, on my home PC with several drives, OneDrive is on D: whereas on my Surface tablet, it's on C:, and it appears that media links in PowerPoint are stored as absolute paths, so the videos can't be found when I'm on my tablet.

Is there a way to make PowerPoint use relative paths for this, or to use Onedrive as the "starting directory"?

3 Answers3

3

Is there a way to make PowerPoint use relative paths for this

In my experience, in current PowerPoint 365 on Windows 10: No.

PowerPoint stores absolute paths to linked external files, even when those files are in the same directory as the presentation (.pptx) file.

PowerPoint stores those paths in the Target attribute of <Relationship> XML elements in the ppt\slides\_rels\slide*.xml.rels files inside the (compressed) .pptx file.

Here, I am restricting my answer to PowerPoint's own behavior, without involving any external manual editing of those Target attribute values.

This ends the body of my answer. The rest is a related postscript; information that I think anyone who is interested in the original question will find interesting.


Suppose you have a .pptx file in OneDrive, with externally linked files either in the same directory as the .pptx or in a subdirectory (here, I'm citing audio .wav files, because that's what I've used for testing):

...OneDrive\...\Parent folder\presentation.pptx
...OneDrive\...\Parent folder\audio1.wav
...OneDrive\...\Parent folder\folder1\audio2.wav

Copy the parent folder and its contents to another location. For example:

C:\temp\Parent folder\presentation.pptx
C:\temp\Parent folder\audio1.wav
C:\temp\Parent folder\folder1\audio2.wav

Open the copy of the presentation from its new location under C:\temp.

Play the audio in PowerPoint. Works, no problem.

Save the presentation in the same directory under C:\temp as a new file name. For example, "C:\temp\Parent folder\presentation-relocated.pptx".

Exit PowerPoint.

Expand the -relocated.pptx file and look at the corresponding Target attribute values. They still refer to the original paths of the .wav files in OneDrive.

No surprises here for me so far.

Rename the original "Parent folder" under OneDrive. For example, to "Parent folder - renamed".

Open one of the copies of the presentation under C:\temp (the original copy or -relocated.pptx, it doesn't matter).

Let's pause for a moment to consider what we've done: we've opened a presentation that refers to external file paths that no longer exist, because we've renamed a directory in those paths.

Play the audio in PowerPoint. Works, no problem.

Wait, what?! How?

Save the presentation in the same directory under C:\temp as a new file name. For example, "C:\temp\Parent folder\presentation-after-renaming-original-path.pptx".

Exit PowerPoint.

Expand the -after-renaming-original-path.pptx file and look at the corresponding Target attribute values.

They're still absolute paths, but they now refer to the .wav files under C:\temp! Not just for the audio file in the same directory as the .pptx file, but also for the audio file in the subdirectory, folder1.

This surprised me: when PowerPoint cannot find linked files at the specified absolute paths, it looks for them in paths relative to the current .pptx file and, if it finds them, updates the links to point to those new absolute paths.

On reflection, I can understand why the PowerPoint developers decided on this behavior: if you move a presentation and its (adjacent) linked files, then you want the links to work at the new location. You want the presentation in the new location to refer to the linked files in the new location. The potential gotcha: if you copy, rather than move—that is, if the linked files are still in their original locations—then PowerPoint won't update the link paths to refer to the new location. While I think this is the correct behavior—to "prefer" the specified location—I wish all of this were better documented. Maybe it is; maybe I've just overlooked those docs.

I'd be grateful if someone could point me to public documentation from Microsoft that describes this behavior.

One more experiment...

Delete the audio files under C:\temp:

C:\temp\Parent folder\audio1.wav
C:\temp\Parent folder\folder1\audio2.wav

Open one of the presentations under C:\temp that still refers to the audio files in their original OneDrive paths: either "C:\temp\Parent folder\presentation.pptx" or "C:\temp\Parent folder\presentation-relocated.pptx" (not "C:\temp\Parent folder\presentation-after-renaming-original-path.pptx").

(Attempt to) play the audio in PowerPoint. PowerPoint displays the following error message:

PowerPoint is unable to locate the linked multimedia file "C:\Users\myusername\OneDrive ... .wav"

The difference here is that, in addition to the original OneDrive paths no longer being available, there are no audio files under C:\temp that PowerPoint can use instead.

Some notes on these experiments, and pointers to possible further investigation (for now, I'll leave that to others):

  • When copying from OneDrive to a different location, I deliberately kept the original name of the parent folder of the .pptx ("Parent folder"), except when—again, deliberately—I renamed it to "break" the links to external files.
  • I also kept the same .pptx file name.
  • Would PowerPoint be able to find external files in the new location if either/both the parent folder and/or .pptx file name had changed? I like to think the answer is yes for every such combination, but I haven't tested them.

I hope this investigation helps others understand PowerPoint's behavior in this area. It definitely helps to look at the corresponding Target attribute values inside the .pptx file!

2

I decided to create a new drive on both PCs. At the command prompt on PC 1:

subst O: C:\Users\cleese\OneDrive

and on PC 2:

subst O: D:\Users\cleese\OneDrive

Now change all the paths to O:..., and the videos will be found in both environments.

Note: How to make SUBST mapping persistent across reboots?

1

Is there a way to make PowerPoint use relative paths for this

For links to files (as opposed to OLE links), if you put the video/sound/image/etc file in the same directory as the PowerPoint file itself before creating the link, you'll normally get a relative link; that is, the link will point to just the file name, no path.

Steve Rindsberg
  • 6,033
  • 1
  • 17
  • 20