简体   繁体   English

使用未安装Outlook客户端的Microsoft.Office.Interop.Outlook

[英]Using Microsoft.Office.Interop.Outlook without Outlook Client installed

I'm trying to enumerate Outlook Global Address List and I don't have Outlook Client installed on a development server. 我正在尝试枚举Outlook全局地址列表,并且我没有在开发服务器上安装Outlook客户端 I'm getting following error 我收到了以下错误

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)).

on the following line 在以下行

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

I assume it's because Outlook Client is not installed. 我认为这是因为没有安装Outlook客户端 Is it possible to use Microsoft.Office.Interop.Outlook without it? 没有它可以使用Microsoft.Office.Interop.Outlook吗?

Anton, 安东,

I assume it's because Outlook Client is not installed. 我认为这是因为没有安装Outlook客户端。 Is it possible to use Microsoft.Office.Interop.Outlook without it? 没有它可以使用Microsoft.Office.Interop.Outlook吗?

Interop files are used for marshalling calls between managed/unmanaged boundaries. Interop文件用于在托管/非托管边界之间编组调用。 There is no the unmananged side in your case (where to marshal the call). 在你的情况下没有无人管理的一面(在哪里整理电话)。

As already was suggested, you can use EWS instead. 如前所述,您可以使用EWS。 See EWS Managed API, EWS, and web services in Exchange for more information. 有关详细信息请参阅Exchange中的EWS托管API,EWS和Web服务

I don't have Outlook Client installed on a development server. 我没有在开发服务器上安装Outlook客户端。

Moreover, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment . 此外, Microsoft目前不建议也不支持任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务)的Microsoft Office应用程序自动化,因为Office可能会出现不稳定的行为在此环境中运行Office时出现和/或死锁

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. 如果要构建在服务器端上下文中运行的解决方案,则应尝试使用已为安全无人值守执行的组件。 Or, you should try to find alternatives that allow at least part of the code to run client-side. 或者,您应该尝试找到允许至少部分代码在客户端运行的替代方法。 If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. 如果从服务器端解决方案使用Office应用程序,则应用程序将缺少许多成功运行的必要功能。 Additionally, you will be taking risks with the stability of your overall solution. 此外,您将承担整体解决方案稳定性的风险。

You can read more about that in the Considerations for server-side Automation of Office article. 您可以在服务器端自动化Office文章的注意事项中阅读有关该内容的更多信息。

It is not possible to use the Interop assemblies without its associated application installed where you need to use it. 如果没有将相关应用程序安装在需要使用它的地方,则无法使用Interop程序集。 The Interop assemblies are used primarily as an advanced application automation system. Interop组件主要用作高级应用程序自动化系统。

If you are using Exchange Server 2007 or later, you could consider using the technique described in this article which uses Exchange Web Services (EWS) to access the Global Address List instead: Querying the Global Address List (GAL) via Exchange Web Services (EWS) 如果您使用的是Exchange Server 2007或更高版本,则可以考虑使用本文中介绍的使用Exchange Web服务(EWS)访问全局地址列表的技术: 通过Exchange Web服务(EWS)查询全局地址列表(GAL) )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft.Office.Interop.Outlook - Microsoft.Office.Interop.Outlook 如何使用 Microsoft.Office.Interop.Outlook 创建默认配置文件并启动 Outlook 客户端 (GUI) - How to create a default profile and launch outlook client(GUI) using Microsoft.Office.Interop.Outlook Microsoft.Office.Interop.Outlook发布内存 - Microsoft.Office.Interop.Outlook Release Memory Microsoft.Office.Interop.Outlook GetFolderFromID - Microsoft.Office.Interop.Outlook GetFolderFromID 摆脱有关Outlook加载项Microsoft.Office.Interop.Outlook的警告 - Get rid of warning on Outlook addin Microsoft.Office.Interop.Outlook 使用 Microsoft.Office.Interop.Outlook C# 在客户端打开 Outlook 2013 新约会窗口 - Open Outlook 2013 New Appointment window at Client side with Microsoft.Office.Interop.Outlook C# 使用Microsoft.Office.Interop.Outlook读取* .msg outlook文件时出现问题 - Problem with reading *.msg outlook file using Microsoft.Office.Interop.Outlook 使用Microsoft.Office.Interop.Outlook连接到Outlook的稳定性C#表单 - Stability C# Forms connected to Outlook using Microsoft.Office.Interop.Outlook Outlook API或使用Microsoft.Office.Interop.Outlook-在C#中获取会议室/位置 - Outlook APIs OR Using Microsoft.Office.Interop.Outlook - Getting meeting room/location in C# 导入命名空间语法以导入“Microsoft.Office.Interop.Outlook” - Import Namespace syntax to import "Microsoft.Office.Interop.Outlook"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM