none
How to determine the default path of Normal.dot using the .Net C# programming language? RRS feed

  • Question

  • I need to determine the absolute path, where the Normal.dot file is located on a target system.

    As i already found out, the default path is as following:

    C:\Users\SomeUserName\AppData\Roaming\Microsoft\Templates

    I do not intend to hard code the absolute path into my application, therefore is need to determine it dynamically using OpenXML.

    Question: How to do this?

    Many thanks in advance

    Martin

    Tuesday, October 14, 2014 2:14 PM

Answers

  • Hi Martin,

    Based on the description, you want to get the file path of the Normal.dot.

    As far as I know, there is no such API in Open XML. If we attache a template a document, we don't need to the specific file path. The Word application save the template file name when we crated a Word document. Here is the XML for your reference:

    And as far as I know, the file location of template is stored under the registry

    Office 2013

    HKEY_Current_User\Software\Microsoft\Office\15.0\Word\Options

    Office 2010:

    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\General

    Office 2007:

    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General

    You can get more detail from link below:
    Word 2013: Templates location and File/New

    How to manage templates in 2007 Office programs and in 2010 Office programs

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 8:51 AM
    Moderator
  • Hi Avionik,

    If we didn't find the registry for an entry, the template path is in the default folder. For example, the default folder for the Office 2013 is C:\Users\{UserName}\AppData\Roaming\Microsoft\Templates.

    I also suggest that you reopen a new thread in Microsoft Communtiy Office forum, if you have any other end user issues.

    Best regads

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 21, 2014 7:11 AM
    Moderator

All replies

  • Hi Martin,

    Based on the description, you want to get the file path of the Normal.dot.

    As far as I know, there is no such API in Open XML. If we attache a template a document, we don't need to the specific file path. The Word application save the template file name when we crated a Word document. Here is the XML for your reference:

    And as far as I know, the file location of template is stored under the registry

    Office 2013

    HKEY_Current_User\Software\Microsoft\Office\15.0\Word\Options

    Office 2010:

    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\General

    Office 2007:

    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General

    You can get more detail from link below:
    Word 2013: Templates location and File/New

    How to manage templates in 2007 Office programs and in 2010 Office programs

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 8:51 AM
    Moderator
  • Many thanks for your answer. I was searching the registry for an entry about this folder, i could not find anything useful for me.

    Any other ideas where i can look for a solution?

    Friday, October 17, 2014 2:39 PM
  • Hi Avionik,

    If we didn't find the registry for an entry, the template path is in the default folder. For example, the default folder for the Office 2013 is C:\Users\{UserName}\AppData\Roaming\Microsoft\Templates.

    I also suggest that you reopen a new thread in Microsoft Communtiy Office forum, if you have any other end user issues.

    Best regads

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 21, 2014 7:11 AM
    Moderator