C# Programming
07-17-2009, 02:41 PM
Hi,
I am trying to traverse all email from Inbox Folder of outlook but after 672 email I got an exception "Spacified cast is not valid" Even Inbox has more than 1600 emails.
My code is like
Microsoft.Office.Interop.Outlook.Items MyItem=mItem.Items;
MyItem.Sort("Received", false);
foreach(Microsoft.Office.Interop.Outlook.MailItem item in MyItem)
{
....
....
}
Please tell me what is the problem?
I am trying to traverse all email from Inbox Folder of outlook but after 672 email I got an exception "Spacified cast is not valid" Even Inbox has more than 1600 emails.
My code is like
Microsoft.Office.Interop.Outlook.Items MyItem=mItem.Items;
MyItem.Sort("Received", false);
foreach(Microsoft.Office.Interop.Outlook.MailItem item in MyItem)
{
....
....
}
Please tell me what is the problem?