"E_Abort" error



When I run the below snippet of code on a Vista Enterprise box using
Outlook 2007, the following error occurs:

"An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in MyApp.exe.
Additional information: Operation aborted {Exception from HRESULT:
0x80004004 (E_ABORT)}"

The snippet is below and the line where the error occurs is
I would appreciate any support, tips, or advice. Thanks.

////begin code/////

private void ProcessPosts(MAPIFolder oFldr, MAPIFolder


int iAttachCnt = 0;

//cycle through each email, filtering out only posts, no
personal emails, calendars, or tasks
string filter = "[MessageClass] = \"IPM.Post\"";
Microsoft.Office.Interop.Outlook.Items oTestItems =

for (int i = oTestItems.Count; i > 0; i--)

Status("Cycling through discussion email...", 10);

//get post message
PostItem oMessage = (PostItem)oTestItems;

//move email

//get attachment count
iAttachCnt = oMessage.Attachments.Count;

//declare subject variable
string strSubject;

//determine if subject is null and set variable
if (oMessage.Subject == null)
strSubject = "";
strSubject = oMessage.Subject.ToString();

//create emails GUID for table
Guid tmpEmID = Guid.NewGuid();

//ERROR OCCURS HERE at "oMessage"
string sem = oMessage.SenderEmailAddress.ToString();

/////end code////

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question