Error when using SharpDevelop

Posted by Sebastian on Stack Overflow See other posts from Stack Overflow or by Sebastian
Published on 2010-06-07T13:46:27Z Indexed on 2010/06/07 13:52 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

I have some code:

Outlook.Application outLookApp = new Outlook.Application();
Outlook.Inspector inspector = outLookApp.ActiveInspector();
Outlook.NameSpace nameSpace = outLookApp.GetNamespace("MAPI");
Outlook.MAPIFolder inbox = nameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
String sCriteria = "[SenderEmailAddress] = '[email protected]'";
Outlook.Items filteredItems = inbox.Items.Restrict(sCriteria);
// totaly sure that count > 0;
Outlook.MailItem item = filteredItems[1];

In the last line I have error: "Cannot implicitly convert type 'object' to 'Microsoft.Office.Interop.Outlook.MailItem'. An explicit conversion exists (are you missing a cast?)". I don't know why. Previous I used VisualStudio 2010 but my trial has expired. Is there any hope to run this on SharpDevelop?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio