How Does PowerPoint Automation Work? The Basics

Jul 10, 2020 | PowerPoint

Have you ever wondered how some apps can manipulate PowerPoint files or even create slides automatically? For example, financial services organizations generate slides with updated numbers in an automated manner every month. At TeamSlide, we can automatically update out-of-date slides or even specific objects on a slide. To understand this, we first need to dive into how PowerPoint files work.

Your slide deck is actually a zip file in disguise that contains a collection of XML files. By simply renaming the file from .pptx to .zip, you can find interesting data, mostly in XML format.

What is XML?

“XML stands for eXtensible Markup Language. It is a markup language much like HTML, except it was designed to store and transport data” – w3schools

Using .XML with PowerPoint Files

Warning: Prior to making manual edits, create a backup copy of your PowerPoint file. Manual edits may corrupt the files.

PowerPoint .xml file

After renaming the file from .pptx to .zip, double click it. You’ll see a variety of folder names and XML files.

PowerPoint .zip contents

By clicking into the ‘Media’ folder, you can view all of the image files that are in your presentation.

View slide images in .xml file

You can even view individual slides from your PowerPoint presentation. Double-click on the ‘Slides’ folder and select a slide file you want to view/edit.

View PowerPoint slides in .xml file

This will show you the XML code, which you can then edit. If you’re an investment banker, you may want to add slides through the XML code. In marketing, you may use this to edit the copy of slides or save quality images from the presentation onto your computer.

XML in PowerPoint

Get to know your new .zip file structure

A .pptx file starts with the file_rels/.rels and then expands to:

  • ppt/presentation.xml
    from which the masters, notes masters and slides are linked

And then expands to:

  • docProps/core.xml
    Metadata including presentation title, editor name, last modified date
  • docProps/thumbnail.jpeg
    A small preview of the first slide – this is where most applications get the preview from including Windows Explorer when showing icons. (This is why PowerPoint’s reuse slides feature only displays the first slide of the presentation. Unlike TeamSlide, it doesn’t generate previews or thumbnails for other slides)
  • ppt/slides/slide1.xml
    (text) content of the first slide

  • ppt/media/*
    Access image files

Useful ways to take advantage of PowerPoint automation:

  • Analyze unexpectedly large file sizes
    • You may find that your PowerPoint file is unexpectedly large when it only has, say, two text-only slides. Investigate the file size issue by unzipping your .pptx file, and you’ll find your answer. In some cases, there may be layout pages and some images taking up space.
  • Create slides automatically (creating XML file) based on data in another form (e.g. Excel)
  • Access all images used in a deck
    • If you unzip your PowerPoint file, you’ll notice a folder called media that contains all of the images in your presentation. You can make changes to images as long as the size doesn’t change. E.g. convert all images to grayscale. If changing the size, consider how it affects the layout in PowerPoint.
  • Read the content of each slide object (parse the XML file) to build search indexes.

  • Edit slide text and create objects like charts
    • Viewing the slide .xml file allows you to edit the content of each slide.
  • Read metadata from files docProps/app.xml and core.xml. Such as:
    • Last editor
    • Last modification date (unlike file system date also available for presentations received via email or downloaded)
    • Number of words in the presentation
  • Read comments
    • View text from ppt/comments/commentX.xml

How TeamSlide uses PowerPoint automation

TeamSlide searches your slide repository and matches your search terms with specific slides. On the backend, this is achieved by indexing individual slides and taking a picture of each one. When you run a search in the TeamSlide pane, TeamSlide then uses the index to search all objects (text, images, videos) within your slides, returning thumbnails of the most relevant slides.  Click on a thumbnail, and with PowerPoint automation, TeamSlide inserts the slide into your presentation. The search and insert capability helps teams maximize efficiency and can even assist with version control.

Share This