Solved

Finding the desktop folder of the current User in Access 2007 VBA

Posted on 2010-11-23
3
450 Views
Last Modified: 2012-05-10
Like it says in the title, I need to find a file on the desktop of the User that has my app open. I have code to look for file in a folder already - but where do I make it look at that desktop folder for the current User? Is there an easy way?

many thanks.
0
Comment
Question by:Peborgh
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 34195968
Environ("USERPROFILE") & "\Desktop" will get you there.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 total points
ID: 34196338
Or you can try the API call available via the code located at: http://www.mvps.org/access/api/api0054.htm

This API call gives you a variety of parameters for locating various folders on the users computer.
0
 

Author Comment

by:Peborgh
ID: 34196833
LSM...: it works! (why am I not surprised...)

Fyed: very comprehensive and will remain in my list of "useful things to know about" but for the moment, I will use LSM...'s simpler solution.

peter
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question