Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Location of special folders (WinXP NL/Word2003 NL)

    After a new install, Word defaults to saving documents in the MyDocuments folder. Normally this folder is located in Cocuments And Settings<user>.... But users can change this:
    - in Word they can change the location in Tools | Options, tab File locations
    - in Windows they can change the location of MyDocuments (using TweakUI etc.)

    You can find Word's location using Options.DefaultFilePath(wdDocumentsPath). Is there a way using VBA to get the location of the MyDocuments folder, or any of the other special folders for that matter? (Windows, Program Files, etc.)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Location of special folders (WinXP NL/Word2003 NL)

    You can use Windows API functions for this. See SHGetSpecialFolderLocation, and click on Special Folder under examples.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Location of special folders (WinXP NL/Word2003 NL)

    Or get the info from the registry:

    Dim strPath As String
    strPath = System.PrivateProfileString("", "HKEY_CURRENT_USERSoftware" & _
    "MicrosoftWindowsCurrentVersionExplorerShell Folders","Personal")

    Look up HKEY_CURRENT_USERSoftware...Shell Folders in RegEdit to see the other available values.

  4. #4
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Location of special folders (WinXP NL/Word2003 NL)

    Thanks (again) Hans!

Posting Permissions

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