简体   繁体   English

在Visual Studio 2012中找不到“ Microsoft Outlook 15.0对象库”

[英]unable to find “Microsoft Outlook 15.0 Object Library” inside Visual Studio 2012

I have Visual Studio 2012 professional edition, and i want to add a reference for "Microsoft Outlook 15.0 Object Library" inside my web project, but i can not find it inside the COM, here is a screen shot from my Visual Studio:- 我有Visual Studio 2012专业版,我想在我的Web项目中添加对“ Microsoft Outlook 15.0对象库”的引用,但我在COM中找不到它,这是Visual Studio的屏幕截图:

在此处输入图片说明

so can anyone advice how i can add the "Microsoft Outlook 15.0 Object Library" to my visual studio 2012 ? 所以谁能建议我如何将“ Microsoft Outlook 15.0对象库”添加到我的visual studio 2012中?

Well, if Outlook is not installed, how can you expect its type library to be present? 好吧,如果未安装Outlook,您如何期望它的类型库存在? You can of course create the interop dll on a machine where Outlook is installed, but your code still won't run without Outlook being present. 你当然可以创建在安装了Outlook的机器上的互操作的dll,但你的代码仍然不会没有Outlook存在运行。

Worse than that, Outlook (just like any Office app) cannot run in a service (such as IIS). 更糟糕的是,Outlook(就像任何Office应用程序一样)无法在服务(例如IIS)中运行。 You can use Extended MAPI (C++ or Delphi) to edit the OFT files, but doing that in C# is far from trivial. 您可以使用扩展MAPI(C ++或Delphi)来编辑OFT文件,但是在C#中这样做并非易事。 And you will still need to install Outlook to have the Extended MAPI system present. 而且,您仍然需要安装Outlook才能具有Extended MAPI系统。 In C#, you can try to use Redemption - it still requires the MAPI system, but unlike OOM, its RDO family of objects can be used in a service. 在C#中,您可以尝试使用Redemption-它仍然需要MAPI系统,但是与OOM不同,它的RDO对象系列可以在服务中使用。 In your case, you can call RDOSession . 在您的情况下,您可以调用RDOSession GetMessageFromMsgFile (it works with both MSG and OFT files), modify the Subject property of the returned RDOMail object, then call RDOMail.Save . GetMessageFromMsgFile (适用于MSG和OFT文件),修改返回的RDOMail对象的Subject属性,然后调用RDOMail.Save

how i can add the "Microsoft Outlook 15.0 Object Library" to my visual studio 2012 如何将“ Microsoft Outlook 15.0对象库”添加到我的visual studio 2012

Looks like you just need to install Outlook first. 看来您只需要先安装Outlook。

Anyway, 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 Services)自动化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. 此外,您将承担整体解决方案稳定性的风险。 Read more about that in the Considerations for server-side Automation of Office article. 在《 服务器端Office自动化注意事项》一文中了解有关此内容的更多信息。

As a workaround you may consider using a low-level API on which Outlook is based on - Extended MAPI. 作为一种解决方法,您可以考虑使用基于Outlook的低级API-扩展MAPI。 Or just use any third-party wrappers around that API. 或者只是使用围绕该API的任何第三方包装。

If you deal only with Exchange account you may also consider using EWS or Outlook REST API, see EWS Managed API, EWS, and web services in Exchange for more information. 如果仅处理Exchange帐户,则也可以考虑使用EWS或Outlook REST API,请参阅Exchange中的EWS托管API,EWS和Web服务以获取更多信息。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM