>Hi.
>I'm using GETFILE to open a file but I
>want to select the 'My Documents' folder
>as starting folder.
>I think that I need to change the current
>directory to 'My Documents' using CHDIR
>and then invoke the GETFILE. Question:
>1) How can I change to 'My Documents' if
> the path depends on the user logged-in?
DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ;
INTEGER hwndOwner, ;
INTEGER nFolder, ;
INTEGER hToken, ;
INTEGER dwFlags, ;
STRING @ pszPath
lcPath = REPL(CHR(0),261)
= SHGetFolderPath(0,0x28,0,0,@lcPath)
lcMyDocuments = LEFT(lcPath,AT(CHR(0),lcPath)-1)
CD (lcMyDocuments)
lcFile = GETFILE()
>or
>2) Is there another way to do that?
You can use Open File from Windows Common Dialog Controls that have more options. Check
Customize the open dialog box in VFP Solutions
--sb--