473,473 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pulling User Environment Settings

18 New Member
I'm trying to pull some user settings in VBA, but I'm not quite sure what the correct syntax is.

I'd like to pull the logged on User Name's My Documents, no matter what version of Windows they are using...XP, 7, or 2003. I think the syntax is Environ("username"), but how do I get Username\My Documents regardless of what version?

Thanks.
Jun 30 '10 #1
3 1793
FishVal
2,653 Recognized Expert Specialist
@jtgarrison
You can use Windows Script Host Object library to retrieve path to "MyDocuments" folder.
Jun 30 '10 #2
jtgarrison
18 New Member
Actually, I figured it out....It's Environ("userprofile")&"\"&environ("username")&"\" &"My Documents".

Thanks.
Jun 30 '10 #3
NeoPa
32,556 Recognized Expert Moderator MVP
That's pretty close. I would use :
Expand|Select|Wrap|Line Numbers
  1. Replace("%P\My Documents", _
  2.         "%P", _
  3.         Environ("USERPROFILE")
Jul 1 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jim Potts | last post by:
What is the best way in Python version 2.x to read/get Windows (nt/2000/xp) system and user environment variables? Thanks for the help! jep
12
by: Aaron Smith | last post by:
What is the best way to handle data in a multiple user environment? We have forms that will allow users to add edit and delete data from a table on SQL server. The data could be edited on multiple...
2
by: Joe Spears | last post by:
Hi Does anyone have any sample code on Pulling user data from Active Directory?? Thanks
3
by: Trapulo | last post by:
What does mean this error? The current configuration system does not support user-scoped settings. I'm accessing a my.settings data from a DAL dll referenced by an ASP.NET app. I've a...
4
by: vighnesh | last post by:
Hello EveryOne Can Anybody help in finding out What are User Software Settings and System Software Settings in Windows Registry.I mean what are all the keys that are concerned to User Software...
3
by: davepkz | last post by:
I have a basic question about managing user.config settings: In my C# app, I save the user's preferences to the config file. But each time I release a new build of the app, something in .NET...
3
MMcCarthy
by: MMcCarthy | last post by:
I know this question has been covered extensively in the past, but I'm wondering if anyone has any new thoughts on the subject. I have a Frontend/Backend Ms Access database. The frontend will be an...
6
by: Steve Kershaw | last post by:
I have a problem in which I'm trying to access a method in a .DLL from an ASP.Net web page (written in C#). I keep on getting the error "The current configuration system does not support...
0
by: active T | last post by:
Hello, Is it possible to setup the user scope settings during the install of a application. In VS2005 I create a setup project. I add a installer class into my application project and...
0
by: mirandacascade | last post by:
Apologies in advance for what I'm guessing may be a trivial question. Assume the following: 1) multi-user environment 2) standard (i.e. not a class module) module with: Public strSample as...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.