get environment variable %userprofile% in code

  • Thread starter Thread starter ruby
  • Start date Start date
R

ruby

I have an application which installs itself on the user's
pc and want to install in the %userprofile% folder. Is
there a way I can get this environment variable using VBA?

Thanks.
Ruby
 
ruby said:
I have an application which installs itself on the user's
pc and want to install in the %userprofile% folder. Is
there a way I can get this environment variable using VBA?

You can use the Environ() function. Here's an example from the
immediate window:

?environ("userprofile")
C:\Documents and Settings\Dirk
 
Thank you very much. So easy!
-----Original Message-----
VBA?

You can use the Environ() function. Here's an example from the
immediate window:

?environ("userprofile")
C:\Documents and Settings\Dirk

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top