Create a PowerPoint Presentation from Access Data

Problem

You need to create similar Microsoft PowerPoint presentations over and over. You currently take an existing presentation, copy it to a new location, and modify it as necessary, resulting in a number of copies of the same text littering your hard disk. It seems that you could just store all the text and its formatting information in an Access table and then create the presentation programmatically when necessary. Then, you could choose just the slides you need, make modifications as necessary, and have only one place where you store the data. Is this possible?

Solution

Microsoft PowerPoint (part of Microsoft Office) offers an amazingly rich set of objects, methods, and properties. Even though it’s not a developer’s tool, its object model is spectacularly deep, especially in comparison to Access’s. It appears that you can do anything programmatically from an Automation client (such as Access) that you can do manually, using PowerPoint as an Automation server—so the answer to the original question is “Yes!” You can definitely create presentations programmatically from Access using tables to store all the information about your presentation.

This solution involves two major activities: setting up the data in tables and using the interface to create your presentation. This section demonstrates both activities.

To try out the sample application, load and run frmPowerPoint from 12-07.MDB. First choose a template from the combo box’s ...

Get Access Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.