我正在尝试枚举Outlook全局地址列表,但是我没有在开发服务器上安装Outlook Client。
我收到以下错误

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Additional information: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).


在下一行

Application app = new Microsoft.Office.Interop.Outlook.Application();


我认为这是因为未安装Outlook Client。没有它,是否可以使用Microsoft.Office.Interop.Outlook?

最佳答案

如果没有在需要使用Interop程序集的关联应用程序的情况下安装它,则无法使用。 Interop程序集主要用作高级应用程序自动化系统。

如果使用的是Exchange Server 2007或更高版本,则可以考虑使用本文中介绍的技术,该技术使用Exchange Web服务(EWS)来访问全局地址列表:Querying the Global Address List (GAL) via Exchange Web Services (EWS)

10-07 19:10
查看更多