Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron,
Thanks for pointing out the caveats. I will be sure to use your code below. Thanks again, Bob "Ron de Bruin" wrote: "My Documents" in Vista, but I could be wrong about that. Correct C:\Users\Ron\Documents The OP can try this If I rename my folder to "DocumentsFromRon" the code will work for me Harlan to open the folder Sub GetSpecialFolder() 'Special folders are : AllUsersDesktop, AllUsersStartMenu 'AllUsersPrograms, AllUsersStartup, Desktop, Favorites 'Fonts, MyDocuments, NetHood, PrintHood, Programs, Recent 'SendTo, StartMenu, Startup, Templates Dim WshShell As Object Dim SpecialPath As String Set WshShell = CreateObject("WScript.Shell") SpecialPath = WshShell.SpecialFolders("MyDocuments") 'Open folder in Explorer Shell "explorer.exe " & SpecialPath, vbNormalFocus End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Harlan Grove" wrote in message ... "Gary Keramidas" <GKeramidasATmsn.com wrote... here' another way fpath = environ("userprofile") & "\My Documents\" ... Not guaranteed to work when users change the name of their "My Documents" folder (which, FWLIW, I've done myself). And I believe it's no longer called "My Documents" in Vista, but I could be wrong about that. The only guaranteed correct way to determine a user's "My Documents" folder's drive/directory path is by going into the Windows Registry, in the HKCU\Software\Microsoft\Windows\CurrentVersion\Exp lorer\Shell Folders key, and finding the value of the Personal value-name. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting File name and path in Excel 2007 Documents | Excel Discussion (Misc queries) | |||
User wants to see full path in recent documents Excel 2007 | Excel Discussion (Misc queries) | |||
How can I automatically print file path on documents | Excel Discussion (Misc queries) | |||
How to path to user's desktop | Excel Programming | |||
Can't See Path to Recently Used Documents in Excel 2000 | Excel Discussion (Misc queries) |