I am using Visual Studio 2010 to create a Outlook 2010 Add In. I try to create a new Outlook AppointmentItem to work with thinking that I can add it to the calendar eventually.
Microsoft.Office.Interop.Outlook.AppointmentItem tempApp = new Microsoft.Office.Interop.Outlook.AppointmentItem();
But when the AddIn runs and trys to create the AppointmentItem object, I get this error on the line above.
System.Runtime.InteropServices.COMException was unhandled by user code
Message=Retrieving the COM class factory for component with CLSID {00061030-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Source=mscorlib
ErrorCode=-2147221164
What can I do to "register the class"? I'm guessing it has to do with Microsoft.Office.Interop.Outlook.dll in some way.
The exception message is not very helpful, they could have done a better job with the COM declaration. This is by design, the class is not registered. You must create an instance of it with the Application.CreateItem() method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With