views:

53

answers:

1

I found several web pages explaining how to get the path of Outlook PST files, but they all use Microsoft.Office.Interop.Outlook. I'd like to avoid a dependency to Office interop assemblies, as they're different for each Office version. Also, this technique is very slow if Outlook isn't already started (since it creates an instance of Outlook).

Is there a simple way to do it without Office interop ?

+1  A: 

Look in the registry. This article shows where it would be for Win2000 and WinNT, I'd assume that it would be in similar locations in other versions of Windows.

Quote from article for Win2000: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\Current Version\Windows Messaging Subsystem\Profiles\profilename\

Edit: More information on finding the value. Look at all the subkeys until you find a key called 001f3006 that have the binary for Personal Folders and then look at the other keys in the same folder and one of them contains the path. (Tested on XP with Outlook 2003)

ho1
I've already looked in the registry, it's not there
Thomas Levesque
@Thomas: I tried it out by creating a new personal folder (I didn't have one before) and it worked for me with WinXP/Outlook2003. Though I had to look at all the subkeys until I found a key called `001f3006` that had the binary for `Personal Folders` and then I looked at the other keys in the same folder and one of them contained the path (in binary form, so not that easy to see of course).
ho1
Indeed, I found it eventually... I didn't expect it to be stored in binary. Thanks !
Thomas Levesque