Navigation:  The Buzz > Operating System  >

FileDlg Default Directory

Previous pageReturn to chapter overviewNext page

11/13/2007 .Button

 

Hello,

Can someone please explain if there is a way to set a default

directory when using the FileDLG function in 9.4.

Thanks

Andy

 

Speaking of FileDlg,I have an old thing which I've never solved. I can specify the folder path to the file but I'd like to pass the file name as well. The aim is to allow the user to select a different file but supply a default value so that he can only hit enter and off he goes. I was trying to use a hidden default if no file is selected but it's confusing and no-one liked it.And me neither because then you can't distinguish it from no selection at all,simply a bad solution.

 

Any ideas?

 

pavel

 

 

Yes, There's a solution.

 

when you use Filefld, for example

 

  filedlg('doc files','*.doc')

 

try to write it like this:

 

  filedlg('doc files','<default directory>\*.doc')

 

or for example:

 

  filedlg('doc files','\mg94\dev\docs\*.doc')

 

and:

if you have several types of file, as much as I know you can use the

path only on the 1st type of files, but i'm not sure of it (check it

yourself).

 

filedlg('doc files','\mg94\dev\docs\*.doc,*.xls,*.txt')

 

Check the archive for Message #76264. Steve Blank gave a very

informative explanation of how to use FileDlg().

 

*** Editor's note: I couldn't find this one. I did find 76240 and 53, which are quoted below.

 

For example, to default to the T: drive for .doc files and allow all files

as an alternative:

 

FILEDLG ('All Files (*.*)','T:\*.*'&CHR (0)&'Document files

(*.doc)'&CHR (0)&'*.doc')

 

HTH

Alan

 


Page url: http://www.magic-iug.com/MIUGWeb3/index.html?hm_filedlg_default_directory.htm