【发布时间】:2017-05-23 06:35:10
【问题描述】:
我一直在尝试使用 IConverterSession 从 EML 转换为 MSG(从 MIME 转换为 MAPI),但我一直在遇到 COM 错误。 我使用 C# MAPIMethods 类来包装 IConverterSession(就像在这里找到的那个:Save Mail in MIME format (*.eml) in Outlook Add-In)。
首先,我遇到了未知 clsid 的问题,通过这篇文章 (https://blogs.msdn.microsoft.com/stephen_griffin/2014/04/21/outlook-2013-click-to-run-and-com-interfaces/) 解决了。
现在正确的注册表项已被编辑,我面临一个新问题:首先,我收到一条错误消息The operating system is not presently configured to run this application,然后我收到一个COMException:Retrieving the COM class factory for component with CLSID {4E3A7680-B77A-11D0-9DA5-00C04FD65685} failed due to the following error: 8007013d The system cannot find message text for message number 0x in the message file for . (Exception from HRESULT: 0x8007013D).
我的代码是:
Type converter = Type.GetTypeFromCLSID(MAPIMethods.CLSID_IConverterSession, true);
object obj = Activator.CreateInstance(converter);
MAPIMethods.IConverterSession session = (MAPIMethods.IConverterSession)obj;
在“object obj = Activator.CreateInstance(converter);”上引发错误
COMException 通常表示“类型是 COM 对象,但用于获取类型的类标识符无效,或者标识的类未注册。”。所以要么Type converter = Type.GetTypeFromCLSID(MAPIMethods.CLSID_IConverterSession, true); 没有返回正确的类型,要么在某处仍然缺少注册表项。
我在 Win 64 位上使用 Office 15 (2013) C2R 32 位。该应用程序是在 x86 构建配置上设置的。
我在某处缺少什么吗?有人可以帮忙吗?
【问题讨论】: