Com Exception While Accessing MailItem from Outlook using c#

Nov 11 2013 4:40 AM
Hi I am working on C# application in which i am trying to read the mails from the Outlook Inbox.
I am using VS2010 and MS-Office 2007, I have added the refernce in the visual studio, The application is working fine in my system, but when i run the same application in client system, its throwing COM exception,
The exception message is like this 

Unable to cast COM object of type System_ComObject to InterfaceType "Microsoft.Office.Interop.Outlook.MailItem" . This operation failed because the QueryInterface Call on the Com Component for the Interface with ID'{00063034-0000-0000-C000-00000000046} failed due to the following error. No such interface supported (Exception from HRESULT: 0x80004002) (E_NONINTERFACE)
 
I am getting exception while trying to access MailItem ex code :
 subject = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).Subject;
I tested in 3 to 4 systems in which VS2010 is installed, and the client system in which its throwing exception doesnt contain vs2010 in it, but .net 4.0 framework,ms-office 2007 is installed in client system. 
 
what may be the error ?
Any suggestions plz ..
Thanks in advance..



Answers (1)