Jamie Garroch (MVP)
asked on
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.
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:
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?
Next, there seems to be a difference between UserTemplates and PersonalTemplates. Each appears to be located in the registry as follows:
UserTemplates:
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?
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)?
For 2013 at least, the default Charts (.crtx store) is in the Charts sub-folder of the personal templates path, e.g. %appdata%\Microsoft\Templa tes\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?
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:
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?
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
PersonalTemplates:HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\PowerPoint\Options
Value Name : PersonalTemplates
Value Type : REG_SZ
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\Templa
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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! ;-)
They don't make it easy, do they?
Thanks for posting your findings. I know that will help someone somewhere sometime! ;-)
ASKER
' Returns the locations for PowerPoint and Chart template folders
Public Sub GetTemplateFolders(Optiona
Dim oWScript As Object
Set oWScript = CreateObject("WScript.Shel
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_CUR
' 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_CUR
' If it's not been defined, use the default
If CRTX = "" Then CRTX = Environ("APPDATA") & "\Microsoft\Templates\Char
Case Is < 15 ' e.g. 2010 and earlier
POTX = oWScript.RegRead("HKEY_CUR
' 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_CUR
' If it's not been defined, use the default
If CRTX = "" Then CRTX = Environ("APPDATA") & "\Microsoft\Templates\Char
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!