R – Get Sharepoint store URL in Outlook

outlookoutlook-2007sharepoint

I'm trying to write an Outlook 2007 VSTO add-in that lets you do some stuff with Sharepoint webservices. I'd really like to make it as simple as possible for the users; ideally, all that they would have to do is connect a Sharepoint list to Outlook. From there, my add-in would ideally grab the actual Sharepoint URL from the list and do its thing. Unfortunately, I can't seem to find where Outlook stores this information while running.

The best solution I've been able to find is to read in the files found in C:\Documents and Settings(username)\Local Settings\Application Data\Microsoft\Outlook*.sharing.xml.obi.

However, these files are only updated when you close Outlook. That means that the user would have to connect to the list, restart Outlook, and then things would work. I'd rather not have things get to that level.

It's almost like the information just magics its way into the sharing.xml.obi files. I've Googled, I've used OutlookSpy and in desperation I've used mfcmapi.exe, all to no avail. Where the heck does Outlook store this?

Best Answer

You can use the object model (or direct MAPI calls) to query this information from the outlook folder. First use the .isSharePointFolder property to locate your folder. The URL of the SharePoint List in outlook is then stored as the subject of a "hidden" message in the associated contents table.

Bonus tip: If you are not using it already, get yourself a copy of the excellent OutlookSpy. It makes figuring this kind of stuff out so much easier.

Related Topic