I am getting error as Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) in outlook. I have debugged the code and found exception in Outlook.Items.Add() method. The code is like this,
Outlook.NameSpace nSpace = null;
Outlook.MAPIFolder InBoxFolder = null;
Outlook._Application OutlookApp = new Outlook.Application();
nSpace = OutlookApp.GetNamespace("MAPI");
InBoxFolder = nSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items FolderItems = InBoxFolder.Folders.GetFirst().Items;
Outlook.MailItem mail = (Outlook.MailItem)FolderItems.Add(Outlook.OlItemType.olMailItem);
Please help me with this. Thanks in advance.
User contributions licensed under CC BY-SA 3.0