我有一些代码:
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] = 'somebody@somewhare.com'";
Outlook.Items filteredItems = inbox.Items.Restrict(sCriteria);
// totaly sure that count > 0;
Outlook.MailItem item = filteredItems[1];
在最后一行我有错误:“无法将类型'object'隐式转换为'Microsoft.Office.Interop.Outlook.MailItem'。存在显式转换(您是否缺少演员表?)”。我不知道为什么。以前我使用 VisualStudio 2010,但我的试用版已过期。有没有希望在 SharpDevelop 上运行它?