The below section should assist anyone attempting to use the MailItem object. The key to this code not throwing exceptions is that the items collection may contain more than just MailItems and therefore the following code allows you to retrieve just the MailItems from the collection.
//create an instance of Outlook
Outlook.Application olApp = new Outlook.Application();
//create a MAPIFolder object pointed to the default inbox
Outlook.MAPIFolder inBox = (Outlook.MAPIFolder)olApp.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
//create an Items collection and pass in the inbox items
Outlook.Items Inboxitems = inBox.Items;
//loop through the items that are MailItem and collect the size of the items
//to get the total size of the inbox
foreach (Outlook.MailItem item in Inboxitems.OfType())
{
InboxSize = InboxSize + item.Size;
}
Obviously once you have a handle to the individual Mailitem you can access all of it's properties. Happy Coding :)