• Finding a filepath (Word XP)

    Author
    Topic
    #381203

    In my template, how would I code “save to file ABC in the ‘default user template’ directory”
    In XP, the default template directory has a filefolder that was created using the user’s name (or some type of naming convention). So, that folder name changes each time. I want to create a template install script that is copying the .dot file to the “default template folder”.
    In my template, how would I code “save to file ABC in the ‘default user template’ directory”

    Viewing 0 reply threads
    Author
    Replies
    • #641392

      If you mean the path that is visible under Tools>Options…>File Locations>User Templates, the code is:

      stringvar = Options.DefaultFilePath(wdUserTemplatesPath)

      • #641432

        If I was creating an install file, how would I identify the file path so that I could place the .dot file in the default folder?

        • #641438

          I’ve used the package and deploy wizard in Office 2000 Developer Edition, and I did not see a convenient way to do it there. It’s something that could be extracted from the registry, I believe, but this is beyond my experience. Other installers might offer more options.

        • #641470

          I tried looking for something like this, for an installer quite a while back and couldn’t find anything that worked on all means of Windows/Office combinations.

          If you do find a way to do it, and like Jefferson says it will probably be a reg key that you need to read, please post the solution here. I would LOVE the solution.

        • #641482

          (Edited by carbonnb on 07-Jan-03 09:42. To add Win2K info)

          OK, I just did a quick test with XPP and Word 2K.

          The default location for the User Templates is:

          C:Documents and SettingsUSERNAMEApplication DataMicrosoftTemplates

          If the UserTemplates path has not changed from the default, a key doesn’t exist in the registry. You need to get info from the registry and piece it together with some hard coded strings.

          You need to get the value from

          HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersAppData

          which should be:

          C:Documents and SettingsUSERNAMEApplication Data

          and the append “MicrosoftTemplates” to the end of that to get the full path.

          If the templates path has changed from the default location then the following reg key will exist:
          HKEY_CURRENT_USERSoftwareMicrosoftOffice9.0CommonGeneralUserTemplates

          This key will point to the templates location.

          I just check the same thing on Win98 and Word 2K, and the same hold true, just the AppData on the hard drive changed (C:WindowsApplication Data on Win98)

          I would think that this should work with Word XP, just by looking at the 10.0 branch instead of the 9.0 branch.

          Added Jan 07, 2002
          I just checked Win2K with W2K and the holds true for this combo as well.

          • #651356

            Awesome, I’ll try it… let you know in a week or so, when I’m back to that project.

    Viewing 0 reply threads
    Reply To: Finding a filepath (Word XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: