Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I execute below code in console application it gives the accurate result but when I try it in windows form it throws COM exception on Outlook.Application app = new Outlook.Application();

C#
The Exception is "Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 
Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."



C#
public static void ReadMail()
        {
            try
            {
               Outlook.Application myApp = new Outlook.Application();
               mapiNameSpace = myApp.GetNamespace("MAPI");
			   
			   ....some coding here...
			   
			 }
            catch (Exception ex)
            {
                
            }
			}


Do you know any solutions?
Posted
Updated 30-May-16 22:59pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900