Find location of “My Documents” with VBA in Windows 7
Posted on 2010-09-13
Because my drive C: was getting too filled, I moved "My Documents" from its usual location of
“C:\Documents and Settings\" & Environ("USERNAME") & "\" & “My Documents”
to the same location on drive “F:”
I would like to have VBA be able to recognize where the new location of “My Documents” is. Other persons who use my programs may also have moved the location of “My Documents,” so any suggestions as to how VBA can find that folder would be most welcome.
Note: my Windows Explorer indicates that drive C: still has a directory named “Documents and Settings” but if one clicks on it, a message appears that the directory is not accessible.
I suppose one could check each drive for the existence of a “My Documents,” but I do not know how to make a loop that could look at each drive on a computer.
Thanks, as always, for your help