PowerPoint 2013: Change in default save type

Mostly, I work with Word and that’s what this blog is usually about. But I do program inter-Office with Excel, PowerPoint and Access, when the need arises. Of those, PowerPoint is my least favorite – I find the object model impenetrable and always have to ask questions of my colleagues in the PowerPoint forum

One of the projects that’s kept me busy the last few weeks is a VSTO add-in for PowerPoint. Simply formulated, it’s a tool to assist in drawing diagrams for Western trail patterns. I want it to work in versions 2007, 2010 and 2013, which it does, with a notable exception in 2013.

One of the things the tool does is to create a new presentation based on a prepared “template” with some boiler-plate text, place-holders and graphics. Coming from Word, it seemed logical to use a “real” template file, a *.potx.

In order to create a new presentation and retain the content of a “template”,┬áit turns out you don’t use the Presentations.Add method, you use Presentations.Open and set the Untitled parameter to “True”:
PowerPoint.Presentation p = pptApp.Presentations.Open(pptFileName.potx, False, True, True);

In PowerPoint 2007 and 2010, when the user saves the presentation the first time, the file format offered is pptx. In PowerPoint 2013 the default file format is *.potx. Note that this doesn’t happen if the user creates a new presentation from a *.potx file, only if the presentation is generated by code.

Obviously, this breaks backwards compatibility and you have to ask yourself, “Why”?

The workaround is to use a *.pptx file instead of a *.potx file – PowerPoint doesn’t care whether a new presentation is based on a “real” template or another presentation…

Another workaround is to use the following code, posted in the General Office Development forum January 29, 2013:

 Dim objPresentation as Presentation
 Set objPresentation = Presentations.Add
 objPresentation.ApplyTemplate "templ.potx"

Leave a Reply