80040154未在Outlook 2010加载项中注册类错误 [英] 80040154 Class not registered ERROR in Outlook 2010 Add In
问题描述
我正在使用Visual Studio 2010创建Outlook 2010加载项.我尝试创建一个新的Outlook AppointmentItem,以期最终可以将其添加到日历中.
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();
但是当AddIn运行并尝试创建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
我该怎么做才能注册课程"?我猜它与Microsoft.Office.Interop.Outlook.dll在某种程度上有关.
What can I do to "register the class"? I'm guessing it has to do with Microsoft.Office.Interop.Outlook.dll in some way.
推荐答案
异常消息不是很有帮助,他们可以使用COM声明做得更好.这是设计使然,该类未注册.您必须使用Application.CreateItem()方法创建它的实例.
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.
这篇关于80040154未在Outlook 2010加载项中注册类错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!