Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

Reference User Profile

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tminn - 29 Sep 2006 20:25 GMT
I'm trying to reference the current Window's user's desktop with some code; I
am using the following:

C:\Documents and Settings\%userprofile%\Desktop

When I run the code I get a "Path not Found" message.  Just to test, I took
out "%userprofile%" and inserted the actual user name and the code ran fine,
so I'm almost positive that that's the problem.  Is that not the correct way
to reference the current user's profle?  Any help would be appreciated.
Douglas J. Steele - 29 Sep 2006 20:31 GMT
strFolder = "C:\Documents and Settings\" & Environ("userprofile") &
"\Desktop"

Having said that, are you SURE that's what you want? On my machine,
userprofile includes C:\Documents and Settings (plus there's always a chance
someone may have his/her profile in a different location). For a far more
reliable approach, see http://www.mvps.org/access/api/api0054.htm at "The
Access Web"

Signature

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

> I'm trying to reference the current Window's user's desktop with some
> code; I
[quoted text clipped - 9 lines]
> way
> to reference the current user's profle?  Any help would be appreciated.
tminn - 29 Sep 2006 20:43 GMT
Thanks, Doug.  You're probably right about user profile locations, so I'll
make use of that article.  Thanks again!

> strFolder = "C:\Documents and Settings\" & Environ("userprofile") &
> "\Desktop"
[quoted text clipped - 18 lines]
> > way
> > to reference the current user's profle?  Any help would be appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.