Office templates location(s) in relation to windows registry

I am trying to write a component of an add-in that will automatically downloads and save templates to the correct current folder for a user, even if the default has been changed by the user and/or IT Group Policy.

There are three issues I am facing.

PART 1 : Terminology and UI


It looks like Office 2013 introduced the content of Personal/Custom templates. This folder can be set by the user in File / Options / Save Regarding terminology:

PowerPoint 2013 Options / Save
I have seen some users see the word  "Custom" while others see "Personal" in the backstage when accessing templates. My first question is why? Is it to do with the version of Office, 365, configuration or something else?

Office (PowerPoint) backstage File / NewOffice templates / Personal
Next, there seems to be a difference between UserTemplates and PersonalTemplates. Each appears to be located in the registry as follows:

UserTemplates:
HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\Common\General
Value Name : UserTemplates
Value Type : REG_SZ

Open in new window

PersonalTemplates:
HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\PowerPoint\Options
Value Name : PersonalTemplates
Value Type : REG_SZ

Open in new window


Neither appear to be set by default so I assume that the Office app will look in a default location if either/both are missing? If so, where is that stored?

PART 2 : Best approach to ascertain where to store templates


In order to determine if the "default" templates location has been changed, which registry keys should I be looking at for Office (more specifically PowerPoint) 2016, 2013, 2010 and 2007 and where should I actually store the templates (User/Personal)?

PART 3 : Charts folder


For 2013 at least, the default Charts (.crtx store) is in the Charts sub-folder of the personal templates path, e.g. %appdata%\Microsoft\Templates\Charts

Is this automatically derived by an Office app by suffixing the Charts folder to the personal templates path or is there a separate registry setting for it?
LVL 14
Jamie GarrochPowerPoint Consultant & DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Echo_SCommented:
Not sure if this will help shed any light on it (so please don't think that I'm trolling for points -- you do know me better than that, I hope!), but when you save a THMX file in PowerPoint, you're automatically taken to this folder: %appdata%\Microsoft\Templates\Document Themes. That's what I'd look for in the registry. (Or maybe that's actually where UserTemplates points?)

When you save a POTX, by default you're taken automatically to \Username\ Documents\Custom Office Templates (or whatever folder's been specified in PPT | Options | Default Personal Templates Location ). I don't have a clean system to check this on, but I wonder if saving a template first (before ever saving a theme) creates a Personal folder and creating a theme first creates the Custom folder.

Actually, what I think has happened is that there have been changes in this space since PPT 2013 came out. I have a blog post about saving a default template in 2013 (http://echosvoice.com/how-to-set-a-default-template-in-powerpoint-2013/ ) and it mentions that PPT no longer takes you to C:\Users\UserName\AppData\Roaming\Microsoft\Templates when you save a template. However, when I tested that today, it DOES take you to that appdata folder. (But then later it DOESN'T. Dayum. How's that for annoying?)

Anyway, this all makes me think that if you're seeing Personal, it may be a leftover from a previous install. Maybe. :-) I think my one install that did show Personal on the start screen at one point now says Custom. I mean, I know it does say custom, but I think it did say Personal at some point in time. Gawd, now I'm babbling. lol

However,I do know that you should store Blank.POTX (the default template) in C:\Users\UserName\AppData\Roaming\Microsoft\Templates. Saving it in the Custom Office Templates folder won't make it the default. PPT looks for blank.potx in %appdata%\Microsoft\Templates.

Re the charts folder, you won't get that when you install Office. That Charts folder gets created automatically when you save your first .CRTX. Or you can create the folder manually (if you just need to copy .CRTX files into the charts folder, for example). No idea what this means to the registry, though.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jamie GarrochPowerPoint Consultant & DeveloperAuthor Commented:
Thanks Echo_S. based on the above pointers and other research, I've done this:

' Returns the locations for PowerPoint and Chart template folders
Public Sub GetTemplateFolders(Optional ByRef POTX As String, Optional ByRef CRTX As String)
  Dim oWScript As Object
  Set oWScript = CreateObject("WScript.Shell")
  On Error Resume Next ' To deal with non-existant registry keys
  Select Case Val(Application.Version)
    Case Is >= 15 ' e.g. 2013 onwards
      POTX = oWScript.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\PowerPoint\Options\PersonalTemplates")
      ' If it's not been defined, use the default
      If POTX = "" Then POTX = Environ("USERPROFILE") & "\Documents\Custom Office Templates\" Else If Not Right(POTX, 1) = "\" Then POTX = POTX & "\"
     
      CRTX = oWScript.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Common\General\UserTemplates")
      ' If it's not been defined, use the default
      If CRTX = "" Then CRTX = Environ("APPDATA") & "\Microsoft\Templates\Charts\" Else CRTX = CRTX & IIf(Right(CRTX, 1) = "\", "Charts\", "\Charts\")
    Case Is < 15 ' e.g. 2010 and earlier
      POTX = oWScript.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Common\General\UserTemplates")
      ' If it's not been defined, use the default
      If POTX = "" Then POTX = Environ("USERPROFILE") & "\Documents\Custom Office Templates\" Else If Not Right(POTX, 1) = "\" Then POTX = POTX & "\"
     
      CRTX = oWScript.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Common\General\UserTemplates")
      ' If it's not been defined, use the default
      If CRTX = "" Then CRTX = Environ("APPDATA") & "\Microsoft\Templates\Charts\" Else CRTX = CRTX & IIf(Right(CRTX, 1) = "\", "Charts\", "\Charts\")
  End Select

I'll soon see if it works once it gets deployed on multiple machines!

Interesting exception you note to the new 2013/2016 scheme for blank.potx!
1
Echo_SCommented:
Yeah, the blank.potx thing is a bit odd. PPT's always looked for blank.potx in the %appdata% Templates folder, so that doesn't surprise me. What does surprise me is that putting that in the Custom (or Personal) folder doesn't do the trick.

They don't make it easy, do they?

Thanks for posting your findings. I know that will help someone somewhere sometime! ;-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.