Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    213
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Finding a filepath (Word XP)

    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"

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Finding a filepath (Word XP)

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

    stringvar = Options.DefaultFilePath(wdUserTemplatesPath)

  4. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    213
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Finding a filepath (Word XP)

    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?

  5. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Finding a filepath (Word XP)

    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.

  6. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding a filepath (Word XP)

    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.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  7. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding a filepath (Word XP)

    <P ID="edit" class=small>(Edited by carbonnb on 07-Jan-03 09:42. To add Win2K info)</P>OK, I just did a quick test with XPP and Word 2K.

    The default location for the User Templates is:

    Cocuments 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_USERSoftwareMicrosoftWindowsCurrentVe rsionExplorerShell FoldersAppData

    which should be:

    Cocuments 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.0CommonG eneralUserTemplates

    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.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  8. #7
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Edison, New Jersey, USA
    Posts
    213
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Finding a filepath (Word XP)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •