2

I am involved in writing a little internal SharePoint portal for our company. I thought it would be a 'quick win' to get create a web part that would display the user's unread mail count, and possibly a list of today's calendar tasks. However, I have had a hunt around for information to do with OWA web services stuff and I can see no easy way of doing this.

Am I being stupid, is there a simple call you can make? If not what would my first steps be in order to achieve what I want?

Thanks!

Loofer
  • 6,841
  • 9
  • 61
  • 102

2 Answers2

2

A few months ago I have done this using CDO Library with C# .NET Windows Service.Example code was like this

            MAPI.Folder inboxFolder = Inbox;
            MAPI.Messages messages = (Messages) inboxFolder.Messages;
            MAPI.MessageFilter filter = (MessageFilter) messages.Filter;
            filter.Unread = true;
caltuntas
  • 10,747
  • 7
  • 34
  • 39
  • Using CDO (either the client/Outlook or the server/Exchange versions) from .Net is not supported by Microsoft as can be seen respectively at http://support.microsoft.com/default.aspx/kb/872895 and http://support.microsoft.com/kb/813349/ for the reasons described at http://blogs.msdn.com/stephen_griffin/archive/2009/04/03/mapi-and-net.aspx – Alfred Myers Jan 12 '10 at 12:17
1

If they're using Exchange 2007, you can use Exchange web services to query the inbox.

Here's the reference in MSDN. The FindFolder operation will return the unread count of a folder. http://msdn.microsoft.com/en-us/library/bb204119.aspx

Visual Studio can generate the proxy classes for you to help you get started: http://msdn.microsoft.com/en-us/library/bb408522.aspx

Jesse Weigert
  • 4,714
  • 5
  • 28
  • 37
  • 1
    Complementing Jesse’s answer, in December 2009, Microsoft released EWS Managed API 1.0 (http://msdn.microsoft.com/en-us/library/dd633709(EXCHG.80).aspx) - a better alternative than auto-generated proxy classes for accessing EWS from .Net clients. – Alfred Myers Jan 12 '10 at 12:31
  • Thanks! This library makes it much easier to use the API. – Jesse Weigert Jan 14 '10 at 09:11