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"?

Tim Pietzcker
  • 2,670
  • 10
  • 43
  • 49
  • I don't think there's a way to set this path.I recommend that you don't use local files as links, you can put videos in the OneDrive online so that every time you open a link, you open from the cloud. – Binggo_ MSFT May 13 '20 at 06:48
  • @Binggo_MSFT: If I don't have an internet connection at the place where I hold my presentation, will PowerPoint know to use the local copy as fallback? – Tim Pietzcker May 15 '20 at 07:00

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!

  • The PowerPoint user interface *does* expose the paths to linked files (File > Info > Edit Links to Files). However, the Links dialog truncates long file paths, which is annoying. Also, in my investigation, I chose to refer to the underlying persisted values in the XML because I wanted to rule out any possible mediation by the UI; for example, it occurred to me that the persisted values might be relative paths, but the UI resolves them to absolute paths. – Graham Hannington Feb 24 '21 at 01:52
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?

Tim Pietzcker
  • 2,670
  • 10
  • 43
  • 49
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
  • 5,605
  • 1
  • 15
  • 18
  • Right, that's one possibility. Of course, it jumbles up the file system structure (videos in one folder, documents in another, pictures in a third...) and makes it harder to find the videos, but that's a tradeoff I need to think about. – Tim Pietzcker May 15 '20 at 07:03
  • "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"... "Normally": can you be more specific? I've tried this in current PowerPoint 365 (on Windows 10): linking to an external audio file in the same directory as the `.pptx` file. The `Target` attribute of the `` element in the corresponding `ppt\slides\_rels\*.xml.res` file (inside the `.pptx`) specifies the absolute file path, not a relative file path. – Graham Hannington Feb 12 '21 at 14:09
  • I haven't paid a lot of attn to the xml_innards of this stuff, but *have* noticed that when you query a relative link's path with e.g. VBA, PPT will report the full path to the current location of the file it found rather than the stored pathless link. For grins, move the PPTX and the audio file it's relatively linked to to another directory and see what the XML says after an open and save (assuming that PPTX can find the file). – Steve Rindsberg Feb 12 '21 at 16:31
  • Re: "For grins". Yes, good suggestion, that was interesting. I've documented that experiment, and subsequent related experiments, in a new answer. – Graham Hannington Feb 23 '21 at 07:58