By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,491 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,491 IT Pros & Developers. It's quick & easy.

Open File / Folder Dialog

P: n/a
Can anyone let me have the code for opening the open file dialog box and
getting either a file or folder name as the output.

I suspect it will look like

Function GetPathOrFile(InputPath as String) As String
......
End function

I seem to be able to get one or the other, but not both Files and Folders. I
need to get the full path

TIA

Phil
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
For the Windows FileOpen/Save dialog, see:
http://www.mvps.org/access/api/api0001.htm

For the folder browse dialog, see:
http://www.mvps.org/access/api/api0002.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Can anyone let me have the code for opening the open file dialog box and
getting either a file or folder name as the output.

I suspect it will look like

Function GetPathOrFile(InputPath as String) As String
.....
End function

I seem to be able to get one or the other, but not both Files and Folders.
I need to get the full path

Nov 13 '05 #2

P: n/a
Thanks Allen for that, however they are not doing what is required.

The problem seems to be that api0001.htm only returns a file name
(together with its path), while api0001.htm returns a path name but doesn't
show any files. In addition there is no starting folder.

Any other thoughts would be gratefully received

Phil
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41**********************@per-qv1-newsreader-01.iinet.net.au...
For the Windows FileOpen/Save dialog, see:
http://www.mvps.org/access/api/api0001.htm

For the folder browse dialog, see:
http://www.mvps.org/access/api/api0002.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Can anyone let me have the code for opening the open file dialog box and
getting either a file or folder name as the output.

I suspect it will look like

Function GetPathOrFile(InputPath as String) As String
.....
End function

I seem to be able to get one or the other, but not both Files and
Folders. I need to get the full path


Nov 13 '05 #3

P: n/a
Not sure I understand the issue.

The reference at:
http://www.mvps.org/access/api/api0002.htm
has recently been updated so it does allow a starting folder.

If you don't like the API calls, there is a FileDialog object in Access 2002
and 2003, but it's not very good. It requires an extra library reference,
does not work for Save As (even though it appears to offer that choice), and
does not work at all in the runtime.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Thanks Allen for that, however they are not doing what is required.

The problem seems to be that api0001.htm only returns a file name
(together with its path), while api0001.htm returns a path name but
doesn't show any files. In addition there is no starting folder.

Any other thoughts would be gratefully received

Phil
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41**********************@per-qv1-newsreader-01.iinet.net.au...
For the Windows FileOpen/Save dialog, see:
http://www.mvps.org/access/api/api0001.htm

For the folder browse dialog, see:
http://www.mvps.org/access/api/api0002.htm
"Phil Stanton" <di********@stantonfamily.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Can anyone let me have the code for opening the open file dialog box and
getting either a file or folder name as the output.

I suspect it will look like

Function GetPathOrFile(InputPath as String) As String
.....
End function

I seem to be able to get one or the other, but not both Files and
Folders. I need to get the full path

Nov 13 '05 #4

P: n/a
Phil Stanton wrote:
The problem seems to be that api0001.htm only returns a file name
(together with its path), while api0001.htm returns a path name but doesn't
show any files. In addition there is no starting folder.


Both work fine for me in A97 and A2003. You can fiddle with the
strFilter value in the function GetOpenFile to show any and whatever
files you want.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #5

P: n/a
"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:ck**********@coranto.ucs.mun.ca...
Phil Stanton wrote:
The problem seems to be that api0001.htm only returns a file name
(together with its path), while api0001.htm returns a path name but doesn't show any files. In addition there is no starting folder.


Both work fine for me in A97 and A2003. You can fiddle with the
strFilter value in the function GetOpenFile to show any and whatever
files you want.

I think what Phil's looking for is a single interface that will let you
choose either a file or a folder. I don't believe that such an interface
exists as an API.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.