Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API Code to determine path to "Add-In" folder 1

Status
Not open for further replies.

TomCarnahan

Programmer
Dec 7, 2002
123
US
I did some research in the archives and found code that will return the path to a number of standard windows folders (ie. My Documents, Desktop, etc). The one I found uses the "apiSHGetSpecialFolderLocation" and "apiSHGetPathFromIDListapi" APIs and passes a CSIDL value (example: for the "Templates" directory, you pass the value "&H15").

Does anyone know the value to pass to retrieve the standard "Add-Ins" folder filepath?

Thank you ahead of time for any assistance you can render! [sunshine]

--- Tom
 
Tom,

What do you mean by "Add-Ins Folder"? Is there some OS level Add-Ins folder or are you referring to a specific Applications Add-Ins folder?

-pete
 
Dear Palbano,

Microsoft uses "add-ins" which are Access or Excel files that are not visible to the user but act as libraries that the regular .mdb and .xls files can refer to for procedures. There is a location (potentially different on every computer) where these add-ins are kept. If you have an add-in stored in this folder, when you start Access or Excel, the add-ins are automatically loaded (hidden) and accessible as a library.

I am running Win98 as my OS. The location of the Add-In folder (created by the OS) on my computer is:

C:\WINDOWS\Application Data\Microsoft\AddIns

For someone else using another configuration or OS, it could be somewhere else. Windows keeps track of where this folder is. I am trying to access a Windows AP that will tell me where it is so that I don't have to "hard code" the location.



-- Tom --- Tom
 
Pete,

The following site by Dev Ashish talks about how one can call two Windows APIs and retrieve a filepath for a specific folder on the PC:


This is what I was talking about. In his documentation, Dev refers to CSIDLs (a value) that when supplied to two APIs ("apiSHGetSpecialFolderLocation" and "apiSHGetPathFromIDList" ), will return a string representing a specific folder's filepath (e.g. "My Documents", "Start Menu", etc.).

What I was trying to determine was the CSIDL (value) to pass to the APIs that would return the filepath to the Microsoft "Add-ins" folder. In Windows 2000 and higher, you can have many user profiles. The file path to this location will change since one directory in the path will go through the User's profile. This is the reason why one cannot hard-code the filepath ... it changes with each user.

Any ideas for what value to pass to the APIs?

Thanks for your interest and help! [sunshine]
--- Tom
 
Pete,

I think you are right. I can always append to the "Applications" folder ... I just thought that there might be another CSIDL number that could get me all the way ... no problem ... and thanks!

--- Tom --- Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top