Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba
Thread: Reference User Profile

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Reference User Profile
tminn 29.09.2006 19:25:02
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.

Re: Reference User Profile
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 29.09.2006 19:31:16
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"

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


"tminn" <tminn[ at ]discussions.microsoft.com> wrote in message
news:C8807713-6561-4741-9745-09490050261A[ at ]microsoft.com...
[Quoted Text]
> 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.
>


Re: Reference User Profile
tminn 29.09.2006 19:43:02
Thanks, Doug. You're probably right about user profile locations, so I'll
make use of that article. Thanks again!


"Douglas J. Steele" wrote:

[Quoted Text]
> 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"
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "tminn" <tminn[ at ]discussions.microsoft.com> wrote in message
> news:C8807713-6561-4741-9745-09490050261A[ at ]microsoft.com...
> > 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.
> >
>
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net