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

Looking for an easy way to browse the file system

P: n/a
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to rely
on a new reference? I've used this code since the Access Version 2.0 days,
so I would figure there has to be something a little more compact, but I
can't seem to find anything in the help file.

Any ideas?

Thanks!
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
No, the API call is still the best way to go. You need the 32-bit version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm

There have been other options over the years, including common dialogs which
were buggy and prone to breaking when you switched versions. As you probably
know, a broken reference breaks the entire app, not just the file open part.

Access 2002 and 2003 have a FileDialog object, but it's also useless. It's
part of the Office library (another reference to break), and so it doesn't
work in the mde/runtime where the Office library is not available. Worse, if
appears to offer the File | Save As choice, but that doesn't work at all.

So, the API call is still the only reliable, consistent approach.

--
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.

"Jozef" <SP**********@telus.net> wrote in message
news:td3ve.1795446$6l.359547@pd7tw2no...
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version 2.0
days, so I would figure there has to be something a little more compact,
but I can't seem to find anything in the help file.

Any ideas?

Thanks!

Nov 13 '05 #2

P: n/a
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to rely
on a new reference? I've used this code since the Access Version 2.0 days,
so I would figure there has to be something a little more compact, but I
can't seem to find anything in the help file.


Avoiding additional references is a *good* thing so avoid the FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.
--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #3

P: n/a
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in the
helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.


Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.
--
'---------------
'John Mishefske
'---------------

Nov 13 '05 #4

P: n/a
Jozef wrote:
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in the
helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.
Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.


Understood. I couldn't tell from your original post. See Allen Browne's response - he's
got the answer you need.
Allen Browne said:
No, the API call is still the best way to go. You need the 32-bit version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm


--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #5

P: n/a
Thanks John

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42**********@newspeer2.tds.net...
Jozef wrote:
Hi John,

Thanks, it's a dialog that I'm looking for though. I'm already familiar
with Dir and GetAttr etc. I can't find much about the browse dialog in
the helpfile, which is why I usually post here.
Thanks!

"John Mishefske" <mi************@JUNKtds.net> wrote in message
news:42********@newspeer2.tds.net...
Jozef wrote:

Hello,

I have some archaic code that I've always used to browse the file
system. Is there anything short and sweet I could use intead, without
having to rely on a new reference? I've used this code since the Access
Version 2.0 days, so I would figure there has to be something a little
more compact, but I can't seem to find anything in the help file.

Avoiding additional references is a *good* thing so avoid the
FileScriptingObject.

The built-in method in VBA to use is Dir() function. Check out the help.

Also the GetAttr() is useful.


Understood. I couldn't tell from your original post. See Allen Browne's
response - he's got the answer you need.
Allen Browne said:
No, the API call is still the best way to go. You need the 32-bit
version of
the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm


--
'---------------
'John Mishefske
'---------------

Nov 13 '05 #6

P: n/a
Thanks Allen! I had a chance to try that out and it's perfect. It's a
WHOLE lot smaller than the current code I'm using.

Thanks again!
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
No, the API call is still the best way to go. You need the 32-bit version
of the code for all versions since Access 95 though. Here 'tis:
http://www.mvps.org/access/api/api0001.htm

There have been other options over the years, including common dialogs
which were buggy and prone to breaking when you switched versions. As you
probably know, a broken reference breaks the entire app, not just the file
open part.

Access 2002 and 2003 have a FileDialog object, but it's also useless. It's
part of the Office library (another reference to break), and so it doesn't
work in the mde/runtime where the Office library is not available. Worse,
if appears to offer the File | Save As choice, but that doesn't work at
all.

So, the API call is still the only reliable, consistent approach.

--
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.

"Jozef" <SP**********@telus.net> wrote in message
news:td3ve.1795446$6l.359547@pd7tw2no...
Hello,

I have some archaic code that I've always used to browse the file system.
Is there anything short and sweet I could use intead, without having to
rely on a new reference? I've used this code since the Access Version
2.0 days, so I would figure there has to be something a little more
compact, but I can't seem to find anything in the help file.

Any ideas?

Thanks!


Nov 13 '05 #7

P: n/a
I realize the original poster specified not setting a new reference.
Although I have written my own versions of api call for file browsing I
have discarded these as I find it much easier to set a reference to
"Microsoft Shell Controls and Automation" and to run:
Dim s As Shell32.Shell
Set s = New Shell32.Shell
s.Explore ("C:\")
The reference exposes a great many procedures, functions and dialogs,
including the BrowseForFolder Dialog.
If one prefers late binding:
Dim s As Object
Set s = CreateObject("Shell.Application")
s.Explore ("C:\")

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.