在Visual Studio 2012中添加Office 2010 Interop(PIA) [英] Adding Office 2010 Interop (PIA) in Visual Studio 2012

查看:173
本文介绍了在Visual Studio 2012中添加Office 2010 Interop(PIA)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在VB.NET中编写一个应用程序,该应用程序将使用Outlook发送电子邮件.我的问题是我需要Office 2010 PIA来执行此操作.以下是我已经尝试过的步骤(我正在使用Visual Studio Express 2012):

I am writing an application in VB.NET that will send emails using outlook. My problem is that I need the Office 2010 PIA to do this. The following are the steps I have already tried (I am using Visual Studio Express 2012):

  • 重启机器
  • 下载并安装了Office 2010 PIARedist
  • 重新启动Visual Studio
  • 重新启动机器
  • 卸载Office和PIA,然后重新安装Office,确保在安装选项中选择了PIA(默认情况下已经选择了PIA,所以大概我也是在第一次安装Office时就安装了PIA).
  • li>
  • 重新启动机器
  • 下载了Office 2010 PIARedist并重新安装
  • 重新启动VS
  • Restarted the machine
  • Downloaded Office 2010 PIARedist and installed it
  • Restarted Visual Studio
  • Restarted the machine again
  • Uninstalled Office and the PIA and re-installed Office, making sure that the PIA was selected in the installation options (it was already selected by default, so presumably I installed it the first time I installed Office as well).
  • Restarted the machine again
  • Downloaded Office 2010 PIARedist and installed it again
  • Restarted VS

每个步骤之后,PIA在VS的添加引用"中仍然不可用,文件也根本不在我的计算机上(搜索"Microsoft.Office.Interop.Outlook.dll"确认了这一点) ).我在MacBook Pro上运行Windows 7.有人知道我的问题在这里吗?对于这样一个简单的功能,这似乎有点可笑.

After each of these steps, the PIA is still not available in "Add Reference" in VS, nor do the files exist on my computer at all (a search for "Microsoft.Office.Interop.Outlook.dll" confirms this). I am running Windows 7 on my MacBook Pro. Does anyone know what my problem is here? This seems like a ridiculous amount of headache for such a simple feature.

PS我需要PIA的唯一原因是能够在电子邮件中添加抄送收件人.而已.如果有人知道如何在没有PIA的情况下执行此操作,请告诉我,因为我宁愿只是执行并完成操作.

PS The only reason I need the PIA is to be able to add CC recipients on the email. That's it. If anyone knows how to do that without the PIA, please let me know because I'd much rather just do that and be done with it.

PSS两次安装PIA本身时,安装都以静默方式结束(没有成功或失败的迹象).

PSS Both times when I installed the PIA itself, the installation ended silently (no indication of success or failure).

推荐答案

万一有人偶然发现了这个问题,我终于弄清楚了如何添加互操作性.由于某些原因,它不会显示在添加引用"窗口中(也许是因为我有VS2012(11.0),并且我正在使用Office 2010 ...?)无论如何,我不得不手动浏览到它来添加它.它位于C:\Windows\assembly中(所有Office 2010互操作性都在其中).同样有趣的是,在整个C驱动器中搜索"Microsoft.Office.Interop.Outlook"或该字符串的缩短版本时,即使它们在驱动器上,也完全没有结果.最后一点:尽管添加引用"窗口中显示"Microsoft Office 14.0对象库",但是添加该引用不允许访问互操作性.

In case anyone stumbles on this question, I finally figured out how to add the interop. For some reason, it won't show up in the "Add References" window (maybe it's because I have VS2012 (11.0) and I'm using Office 2010...?) Anyway, I had to manually browse to it to add it. It was located in C:\Windows\assembly (all of the Office 2010 interops were in there). Also interesting was that a search of the entire C drive for 'Microsoft.Office.Interop.Outlook' or shortened versions of that string turned up absolutely no results, even though they are on the drive. One last note: although 'Microsoft Office 14.0 Object Library' shows up in the "Add References" window, adding that reference did not allow access to the interop.

这篇关于在Visual Studio 2012中添加Office 2010 Interop(PIA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆