gpt4 book ai didi

c# - 80040154 类未在 Outlook 2010 加载项中注册错误

转载 作者:行者123 更新时间:2023-11-30 14:16:55 27 4
gpt4 key购买 nike

我正在使用 Visual Studio 2010 创建 Outlook 2010 加载项。我尝试创建一个新的 Outlook AppointmentItem,并认为我最终可以将它添加到日历中。

Microsoft.Office.Interop.Outlook.AppointmentItem tempApp = new Microsoft.Office.Interop.Outlook.AppointmentItem();

但是当 AddIn 运行并尝试创建 AppointmentItem 对象时,我在上面的行中收到此错误。

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

我该怎么做才能“注册类(class)”?我猜它在某种程度上与 Microsoft.Office.Interop.Outlook.dll 有关。

最佳答案

异常消息不是很有用,他们可以用 COM 声明做得更好。这是设计使然,该类未注册。您必须使用 Application.CreateItem() 方法创建它的一个实例。

关于c# - 80040154 类未在 Outlook 2010 加载项中注册错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6680761/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com