C#双展望2007/2010 VSTO加载项 [英] C# dual Outlook 2007/2010 VSTO Add-in

查看:199
本文介绍了C#双展望2007/2010 VSTO加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要创建一个VSTO加载在C#中,同时支持Outlook 2007和2010。

We need to create a VSTO add-in in C# that supports both Outlook 2007 and 2010.

要开始了,我们创建了3个项目:

To start off we created 3 projects:

  1. 文件 - >新建项目 - >办公室 - > 2007-> Outlook 2007的加载项
  2. 文件 - >新建项目 - >办公室 - > 2010-> Outlook 2010的加载项
  3. 文件 - >新建项目 - > Windows的>类库

所有共享code是在项目#3。

All shared code is in project #3.

到目前为止,我们已经部分开发加载项并一直在使用的ClickOnce部署进行测试。

So far, we have partially developed the add-in and have been using ClickOnce deployments for testing.

有一天,我们发现有人在附加安装了2010年2007年展望,也没有不良影响任何责任。

One day, we noticed someone installed the 2010 add-in for 2007 Outlook and had no ill effects whatsoever.

那么几个问题:

  • 是否有任何理由来创建 2007 VSTO项目?我们可不可以 创造了2010年项目?
  • 或者是唯一的不同版本 办公室的运行时间是 由ClickOnce的自举 安装程序?你可以只安装2010运行时为Outlook 2007?
  • 如果没有区别,为什么 有两个Visual Studio项目 模板?
  • Is there any reason to create the 2007 VSTO project? Can we just create the 2010 project?
  • Or is the only difference the version of the office runtime that is bootstrapped by the ClickOnce installer? Can you just install the 2010 runtime for Outlook 2007?
  • If there is no difference, why are there two Visual Studio project templates?

在我们的最终解决方案,我们将使用WiX的安装程序,它也在努力迄今。该WiX的安装程序将大大简化,如果我们可以用1个项目的加载项。

In our final solution, we will be using a WiX installer, which is also working thus far. The WiX installer will be simplified greatly if we can use 1 project for the add-in.

推荐答案

是否有任何理由来创建2007 VSTO项目?我们可以只创建了2010年项目?
你可以只用2010年的项目,但如果你不小心引用任何2010只的API,例如访问任何新对话的API会导致您的外接炸毁在2007年。

Is there any reason to create the 2007 VSTO project? Can we just create the 2010 project?
You can just use the 2010 project, but if you accidentally reference any 2010 ONLY api's, for example accessing any of the new conversation API's will cause your add-in to blow up in 2007.

或者是唯一的区别是由的ClickOnce安装程序自举的办公室运行时的版本?你可以只安装2010运行时为Outlook 2007?
基本上你正在编写一个VSTO 3.0加载项,同时适用于2007年和2010年VSTO并不真正关心你写的,只有你的加载项是一个VSTO 3.0加载哪个模板。

Or is the only difference the version of the office runtime that is bootstrapped by the ClickOnce installer? Can you just install the 2010 runtime for Outlook 2007?
Basically you are writing a VSTO 3.0 add-in, which works for both 2007 and 2010. VSTO doesn't actually care which template you are writing for, only that your add-in is a VSTO 3.0 add-in.

如果没有区别,为什么有两个Visual Studio项目模板?
2个原因,我可以看到,F5调试支持,并确保你没有访问一个新的API

If there is no difference, why are there two Visual Studio project templates?
2 reasons that I can see, F5 debugging support, and to make sure you do not access a new API'

如果您不下去的唯一2010外接路上,我建议你做对Microsoft.Office.Interop.Outlook V12 PIA的解决方案,它会告诉你,你正在访问的任何新的API进行编译。如果你想针对一些新的API只是如果你的外接托管于2010年再看看<一href="http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx">http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx

If you do go down the only 2010 add-in road, I suggest you do a compile of the solution against the Microsoft.Office.Interop.Outlook v12 PIA which will show you any new API's that you are accessing. If you do want to target some of these new API's only IF your add-in is hosted in 2010 then have a look at http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx

这篇关于C#双展望2007/2010 VSTO加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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