Extract Media from Office Files
Operator: Abdulla Al Fahad. How tools are built and checked
A slide exported as an image, or a screenshot of one, is a poor copy of the logo you were asked for: the picture itself, at the size stored in the file, is still inside the deck. A .docx, .pptx or .xlsx is a ZIP archive, and every picture, video and sound clip pasted into it sits in that archive as an ordinary file, which is why it can be lifted out untouched.
Key features
- Pictures, video and audio from DOCX, PPTX and XLSX, and the pictures of ODT, ODS and ODP
- Where each file is used: slide number, sheet name, document part, and order of appearance
- Unused files and byte-identical copies flagged from the ZIP directory alone
- Thumbnails for browser-displayable pictures up to 1.5 MB, for the first 80 in each file
- Names as stored, or starting with where the file is used; one folder per file when several are dropped
- Up to 20 files of 500 MB, saved one at a time or ticked into a ZIP of up to 500 MB
Where each Office format keeps its media
Each format has one folder for media, and for OpenDocument only the Pictures folder is read, so video or audio embedded in an .odt, .ods or .odp may be stored elsewhere and not listed: word/media in a Word file, ppt/media in PowerPoint, xl/media in Excel, and Pictures in OpenDocument files (.odt, .ods and .odp). The type is taken from the file extension, so pictures, video and audio are told apart and anything else is listed as Other. EMF and WMF are Windows vector formats and TIFF is not shown by browsers; they are listed without a preview and extract normally. Media that is linked rather than embedded, a clip pointing at a path on disk or a web address, is not in the file and so is not listed. Document thumbnails, embedded objects and fonts are outside the media folders and are not extracted.
Where a file is used comes from the relationship parts of the document. In PowerPoint the slide order is read from the presentation's slide list, so "Slide 3" is the third slide in the deck rather than the file named slide3.xml; pictures on layouts and masters are marked shared, and notes pages are marked too. In Word the labels are body, header, footer, footnotes and endnotes, plus the order in which pictures first appear. In Excel a picture is traced from its drawing to the sheet that holds it. In OpenDocument files the links in content.xml give the body or, in a presentation, the slide, and styles.xml gives headers, footers and backgrounds. A file that nothing refers to is marked not referenced. Two media files with the same size and CRC-32 are flagged as the same bytes without being unpacked.
How it works
The list is built from the ZIP's central directory plus the small XML parts that say where media is used, never from the media themselves, so even a 400 MB deck lists quickly. A file is inflated only when you save it or ask for its thumbnail, with the browser's own decompression, and its size and CRC-32 are checked against the directory; an entry that unpacks to more than its declared size is stopped as a possible zip bomb.
Output names are cut to their last path segment and cleaned, so a stored name cannot place a file outside the ZIP, and repeats get " (2)" before the extension. The ZIP stores media as it is, since pictures and video are already compressed.
Common use cases
- A 60-slide deck from a client: untick Video and Audio, find the logo marked Slide layout (shared), and save it at the pixel size it was inserted at.
- Recovering the 31 photos from a 60-slide deck for a web page: choose names that start with where each is used, tick the Pictures, and the ZIP lists them in slide order.
- An Excel price list with product thumbnails: the Used in column names the sheet each picture sits on, which the file names alone never do.
- A Word report swollen to 120 MB by an embedded MP4: the list shows the video, its size and that it sits in the document body, so it can be saved out and replaced with a link.
- A folder of 20 lecture decks: drop all of them, filter to Audio, and collect every narration clip in one ZIP with a folder per deck.
How to use this tool
- Drop one or more Office files.
- Filter by type and choose how names are built.
- Save single files with their Save button, or tick rows and press ZIP of ticked.
Example
A deck with four media files; presentation.xml lists slide2.xml before slide1.xml
ppt/media/image1.png: used by both slides
ppt/media/image2.png: the same bytes as image1.png, referenced by nothing
ppt/media/unused.jpeg: referenced by nothing
ppt/media/media1.mp4: used by slide1.xmlThe list, and names with "where it is used" selected
image1.png: Slide 1 and Slide 2, picture 1 on its first slide
image2.png: not referenced, same bytes as image1.png
unused.jpeg: not referenced
media1.mp4: Slide 2 (the video's slide is second in the deck although its file is slide1.xml)
Names: slide-1_image1.png, image2.png, unused.jpeg, slide-2_media1.mp4Tips for best results
- Pictures marked Slide layout (shared) or Slide master (shared) are the template's own artwork, such as a footer logo on every slide; untick them to take only slide content.
- The same-bytes flag lets you tick only the first copy of a logo that was pasted under several names.
- EMF and WMF files open in LibreOffice Draw or Inkscape, where they can be saved as SVG or PNG.
- With several documents in one ZIP, each gets a folder named after the file plus a number, so two decks both called Quarterly Review do not merge.
Common pitfalls
Crops and colour changes made in PowerPoint are stored in the slide's XML, so the extracted picture is normally the uncropped, uncorrected one. The exception is a file saved with Delete cropped areas of pictures or Compress Pictures (220 ppi by default), which already lowered the picture inside the file.
Charts, SmartArt and shapes are drawings described in XML, not media files, so they do not appear here.
OpenDocument files keep no page numbers for pictures, so the location comes from the links in their XML and a picture used only from an embedded object or a macro shows as not referenced.
Common errors and how to fix them
- "No ZIP end-of-archive record was found"
- The file is probably encrypted with a password to open, which Office stores in a different container, or it is an old .doc, .ppt or .xls. Remove the password or save as .docx, .pptx or .xlsx in the program that made it.
Best practices
- Work in two passes on a big deck: tick the pictures and build that ZIP, then do the video separately, so one 90 MB clip does not push the first ZIP towards its 500 MB limit.
- Read the Used in column before ticking: rows marked not referenced are usually leftovers from deleted slides or pages, not media anyone still sees.
Where each format keeps its media
The folder is fixed by the format, which is why one reader covers all of them.
- DOCX: word/media, referenced by document.xml, headers, footers and notes.
- PPTX: ppt/media, referenced by slides, layouts, masters and notes pages.
- XLSX: xl/media, referenced from drawings that belong to sheets.
- ODT, ODS and ODP: Pictures, referenced from content.xml and styles.xml.
What original quality means here
Saving copies the bytes Office stored, so a JPEG comes out as the same JPEG and its CRC-32 matches the one in the archive. That is the quality of the file as saved: Word and PowerPoint can shrink a picture on insert or when the file is saved with Compress Pictures, so this is not always the photograph you started from.