Getting "My Documents" Path

  • Thread starter Thread starter Astidis
  • Start date Start date
A

Astidis

I am using Access 2000 and I would like to get the default path for the data
folder as defined by windows. I would like the command to work both for a Win
98/ME (Since it is usally C:\My documents) but also on an NT/XP machine where
it is under the user's profile. Does such a command exist or is there a chunk
of code available somewhere?

Thanks,

Alex A
 
Hi Alex,

Try
Application.GetOption("Default Database Directory")
(although it looks as if it would be no fun to write an
internationalised version of that!).
 
Do you really want the users 'My Documents' folder, or do you want the
Access default database folder? They may not be the same.

If you want the Access default database folder, see John's response
elsewhere in this thread. But if you want the 'My Documents' folder, see the
API code at the following URL ...

http://www.mvps.org/access/api/api0054.htm

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top