Excel path in Outlook

T

Trefor

In Excel I use "Application.UserLibraryPath" as part of a path to a file. Is
there an equivalent on Outlook that will take me to the same place?

I actually want to get to "C:\Documents and Settings\<username>\Application
Data\"
 
J

JP

Application.VBE.ActiveVBProject.References.Item("Excel").FullPath

returns the path to the Excel object library, which in Excel's case is
the Excel executable file itself. Assuming, of course, you have set a
reference to the Excel object library in Outlook.

Does that help?

--JP
 
T

Trefor

JP,

Not really, but I found the following that will do the trick:

UserFile = "C:\Documents and Settings\" & Environ("username") &
"\Application Data\......."
 
D

Dmitry Streblechenko

"Application Data" is locale specific and will be different under
non-English versions of Windows.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
S

Sue Mosher [MVP-Outlook]

It's also different in different operating systems. Try using Environ("appdata") instead.
 
T

Trefor

Sue / Dmitry,

Thanks for you comments.

In my case the file I am looking for was put there using the same path and
my code is only deployed in 2000/XP Office 2003 environments, but I take your
point.

Thanks.

--
Trefor


Sue Mosher said:
It's also different in different operating systems. Try using Environ("appdata") instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top