tags:

views:

224

answers:

5

I have a requirement where i need to get the data from a folder called "Pulic floder" which contains global information like book rooms for discussuions / meetings etc and this folder is in server and I am able to access this through oulook. Can any one help me out how do I access the same programatically, C# ?

Thanks in Advance, Ravi Naik.

+1  A: 

If you're solely on the client use COM via Outlook. Or use WebDav against Exchange 2003, or check out the new webservices for Exchange 2007.

It all depends where your code will execute and/or the version of Exchange running before deciding the way to go.

You just have to make sure the application is running as a user with permissions to Exchange.

Mikael Svenson
A: 

I know you said C#, but if you're willing to experiment a bit, here's a Perl solution I've used successfully in the past:

http://rasterweb.net/raster/code/src/vcalxical_pl.txt

You need IMAP enabled on the Exchange server and this will only work with 2003. In Exchange 2007 calendar information is no longer stored in folders, so this will break. You also said you just needed to get the data, not modify it.

This solution will work with Exchange 2007:

http://blogs.msdn.com/exchangedev/archive/2009/02/05/quick-and-dirty-unix-shell-scripting-with-ews.aspx

Jim Brandt
A: 

Ksempac, look here for a way forward:

http://msdn.microsoft.com/en-us/library/ms268893(VS.80).aspx

The Microsoft.Office.Interop.Outlook namespace is horrible to work with, but with a bit of Googling you can do some cool stuff.

Ubiquitous Che
A: 

In the past we used Outlook Redemption. It works through extended MAPI so it has more features then Outlook provides with Microsoft.Office.Interop.Outlook

There is also another useful tool - Outlook Spy that allow you to discover Outlook object model in run time.

Bogdan_Ch
A: 

I modified the code to loop through sub folders, sorry for the delayed response

using System;
using OutLook = Microsoft.Office.Interop.Outlook;

class OutlookFolders
{
    static void Main(string[] args)
    {
        OutLook.Application outlookObj = new OutLook.Application();
        GetSubFolders(outlookObj.Session.Folders);
    }
    private static void GetSubFolders(OutLook.Folders folders)
    {
        foreach (OutLook.MAPIFolder f in folders)
        {
            Console.WriteLine(f.Name);
            GetSubFolders(f.Folders);
        }
    }
}
Travis
Thank you very much for the above code, but I have folder called "Pulic Folders", that I am able to access it but how do i get inner folders present with in "Public Folders"?
Ravi Naik