C # dual Outlook 2007/2010 VSTO Add-in

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

To start, we created 3 projects:

  • File-> New Project-> Office-> 2007-> Outlook 2007 Add-in
  • File-> New Project-> Office-> 2010-> Outlook 2010 Add-in
  • File-> New Project-> Windows-> Class Library

All common code is in project # 3.

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

We once noticed that someone installed the 2010 add-in for Outlook 2007 and had no harmful effects.

So a few questions:

  • Is there any reason to create a 2007 VSTO project? Can we just create a 2010 project?
  • Or is this the only difference in the version of office hours that is downloaded using the ClickOnce Installer? Can you just install the 2010 runtime environment for Outlook 2007?
  • If there is no difference, why are there two Visual Studio project templates?

In our final decision, we will use the WiX installer, which also works so far. The WiX installer will be greatly simplified if we can use 1 project for the add-in.

+6
source share
1 answer

Is there any reason to create the 2007 VSTO project? Can we just create the 2010 project?
You can simply use the 2010 project, but if you accidentally refer to all ONLY 2010 api, for example, access to any of the new conversation APIs will cause the add-in to explode in 2007.

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 that works both in 2007 and 2010. VSTO does not actually care about which template you are writing, only that your add-in is a VSTO 3.0 add-in.

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

If you go down the only path of the 2010 add-in, I suggest that you compile the solution with the Microsoft.Office.Interop.Outlook v12 PIA, which will show you any new API that you are accessing. If you want to target some of these new APIs only if your add-in was hosted in 2010, 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

+6
source

Source: https://habr.com/ru/post/888358/


All Articles