how to extract computer name

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

Hi all,

I want to use the computer name to name a file.

I have few computers that send files each hour in a directory
I want to avoid collision
How can i extract the computer name in vba?
i will use it in the file name

Regards,
Pierre
 
BTW: After posting the suggestion using Environ$, it occurred to me to
wonder whether that might be locale specific? In other words, would you need
to replace 'computername' with something else on a PC running a non-English
version of Windows? I expect you probably would, but I don't have a
non-English version of Windows on which to test the theory.

Anyhow, if for this or other reasons you need a more robust solution to the
problem you could try the API code at the following URL ...

http://www.mvps.org/access/api/api0009.htm
 
Back
Top