Share via

How to identify the template used to create a PowerPoint presentation

Anonymous
2021-07-06T20:37:03+00:00

I have a need to uniquely identify the potx template used to create a pptx file.

There are two existing places where the template name is used but neither are 100% reliable for my need.

This one can return null in some cases, or "blank" if the template has been deployed as the default "blank.potx" file:

Presentation.BuiltInDocumentProperties("Template")

This one does not do what one would think or what the documentation used to say and I corrected it recently on GitHub to reflect that it returns the name for the first design (master) in the presentation:

Presentation.TemplateName

So I had planned to develop a 'thumbprint' function which would analyse the Name properties for all of the masters and layouts in the Presentation.Designs collection.

This too has a problem in that the names returned are not always in English if the Office language is not English. It seems that Microsoft are translating the static name in the XML of the file for default layouts for both the presentation of it in the UI and the Object Model, for both the Name and MatchingName properties.

It appears there is no separation for Name and DisplayName (as there is for animation objects) when it comes to Design and CustomLayout objects.

Any ideas how to solve the original need, taking into account that the potx and pptx files are pre-existing so I can't use Tags or any other metadata to identify them? The only thing I can think of is building a table for the 11 default layouts for all 91 languages but tedium aside, that leads to a UTF issue as the solution needs to work on both Windows and macOS.

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. John Korchok 232.7K Reputation points Volunteer Moderator
    2021-07-07T15:33:44+00:00

    Just a side note on including multiple slide masters in a deck. We only do that if every slide master has the same layouts and the client want to be able to mix and match different color themes. Otherwise, clients will see wacky results when pasting slides. Here's my article with the details: Multiple Slide Masters: Beware! - Best Practices

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-07-07T13:14:16+00:00

    @John Korchock. I'm trying to reassign the layout after a slide has been copied from deck A and pasted to deck B, in the case where PowerPoint creates a new master and/or layout. For most of the templates we create we add new custom layouts to the redesigned default layouts rather than deleting the defaults so in the locale case, the name will return a mix of English for the custom layouts and the user's language for the rest. Some templates also have multiple masters and in that case the layouts are all custom and hence in our control. Note too that "Office Theme" for the master/design name also gets translated but that "should" be changed at the time the template is designed, but is often forgotten.

    @John Wilson. I'm seeing null when using the default Office template and maybe there are other cases. FWIW, I also see odd strings when using other Office templates e.g. "TM16401375[[fn=Madison]]"

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2021-07-07T09:17:51+00:00

    AFAIK the only place PPT stores a reference to the name of the template is in BuiltInDocProps (or in the corresponding XML in app.XML. I can see this would return Blank if the template was called Blank(!), but i haven't been able to get Null. What causes that?

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. John Korchok 232.7K Reputation points Volunteer Moderator
    2021-07-07T01:06:08+00:00

    Can you give a little background about what problem you're trying to solve with this? We're mostly creating custom templates that don't have just the standard 11 layouts. Most of our end-user clients have idiosyncratic templates that would make identification pretty easy.

    Unlike Word, which depends on a link to the template for content, macros, etc., PowerPoint just sucks the whole template into a new presentation and has no real link to it after that. Consequently, Microsoft seems to have assumed that documenting the source in the final file is relatively unimportant.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2021-07-07T14:09:43+00:00

    >> FWIW, I also see odd strings when using other Office templates e.g. "TM16401375[[fn=Madison]]"

    These would be, I think, some of the default themes shipped with Office.

    Look in:

    %appdata%\Microsoft\Templates\LiveContent\16\Managed\Document Themes\1033\

    1033 is for USian English. If you're set to BritSpeak it'll be different, I expect.

    Was this answer helpful?

    0 comments No comments