Hi to all,

I'm trying to locate the current "My Documents" folder programmatically to
point the default directory when I call PUTFILE() function. How can I do
this? I've tried GETENV() but it doesn't give me the "My Documents"
folder...

Any help would be much appreciated... Thanks.

Allan

RE: Locating "My Documents" folder by JohnFenton

JohnFenton
Mon May 09 20:39:01 CDT 2005


Assuming VFP9 see the "Common System Folders Foundation Class" in the help
system. It's done using the shfolder.dll

John Fenton

"Allan" wrote:

> Hi to all,
>
> I'm trying to locate the current "My Documents" folder programmatically to
> point the default directory when I call PUTFILE() function. How can I do
> this? I've tried GETENV() but it doesn't give me the "My Documents"
> folder...
>
> Any help would be much appreciated... Thanks.
>
> Allan

Re: Locating "My Documents" folder by Edhy

Edhy
Mon May 09 20:39:25 CDT 2005

Hi Allan,

All System folder location are store in this key for the current logged
user:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders]

The one you need is the "Personal" which will hold the location to the My
Documents folder. Use any registry program to grab that information, also
using RegEdit, take a look at all the info there.

--
Edhy Rijo
www.progytech.com
Bronx NY


"Allan" <Allan@discussions.microsoft.com> wrote in message
news:3D72CA16-3A2A-4E80-980D-B5B48912DF84@microsoft.com...
> Hi to all,
>
> I'm trying to locate the current "My Documents" folder programmatically to
> point the default directory when I call PUTFILE() function. How can I do
> this? I've tried GETENV() but it doesn't give me the "My Documents"
> folder...
>
> Any help would be much appreciated... Thanks.
>
> Allan



Re: Locating "My Documents" folder by Michel

Michel
Tue May 10 03:46:25 CDT 2005

Allan,

#Define CSIDL_PERSONAL 5 &&Personal Documents Folder
Local lCSpecialFolderPath
lCSpecialFolderPath = space(255)
*** Declare API's
Declare SHGetSpecialFolderPath IN SHELL32.DLL ;
LONG hwndOwner, ;
STRING @lcSpecialFolderPath, ;
LONG nWhichFolder

*** Get Special Folder Path
SHGetSpecialFolderPath(0, @lCSpecialFolderPath, CSIDL_PERSONAL)

*** Format Special Folder Path
lCSpecialFolderPath=SubStr(RTrim(lCSpecialFolderPath),1, ;
Len(RTrim(lCSpecialFolderPath))-1)

lCspecialFolderPath is "My Documents" folder...

"Allan" <Allan@discussions.microsoft.com> a écrit dans le message de news:
3D72CA16-3A2A-4E80-980D-B5B48912DF84@microsoft.com...
> Hi to all,
>
> I'm trying to locate the current "My Documents" folder programmatically to
> point the default directory when I call PUTFILE() function. How can I do
> this? I've tried GETENV() but it doesn't give me the "My Documents"
> folder...
>
> Any help would be much appreciated... Thanks.
>
> Allan



Re: Locating "My Documents" folder by Allan

Allan
Tue May 10 19:01:02 CDT 2005

Thank you guys... I'll check it out...

"Michel Lévy" wrote:

> Allan,
>
> #Define CSIDL_PERSONAL 5 &&Personal Documents Folder
> Local lCSpecialFolderPath
> lCSpecialFolderPath = space(255)
> *** Declare API's
> Declare SHGetSpecialFolderPath IN SHELL32.DLL ;
> LONG hwndOwner, ;
> STRING @lcSpecialFolderPath, ;
> LONG nWhichFolder
>
> *** Get Special Folder Path
> SHGetSpecialFolderPath(0, @lCSpecialFolderPath, CSIDL_PERSONAL)
>
> *** Format Special Folder Path
> lCSpecialFolderPath=SubStr(RTrim(lCSpecialFolderPath),1, ;
> Len(RTrim(lCSpecialFolderPath))-1)
>
> lCspecialFolderPath is "My Documents" folder...
>
> "Allan" <Allan@discussions.microsoft.com> a écrit dans le message de news:
> 3D72CA16-3A2A-4E80-980D-B5B48912DF84@microsoft.com...
> > Hi to all,
> >
> > I'm trying to locate the current "My Documents" folder programmatically to
> > point the default directory when I call PUTFILE() function. How can I do
> > this? I've tried GETENV() but it doesn't give me the "My Documents"
> > folder...
> >
> > Any help would be much appreciated... Thanks.
> >
> > Allan
>
>
>