views:

29

answers:

1

I'm trying to create a Word 2010/2007 VSTO add-in and have run into a couple of questions:

  1. If I use the Backstage View and other 2010 features in the Ribbon, how will Word 2007 handle them? (i.e. do I need to do some kind of conditional checking for version? If so, how?)
  2. The whole Primary Interop thing. Does setting a reference to Word 14.0 and embedding the primary interops allow me to deploy to Word 2007 without new primary interops?

Thanks in advance!

+3  A: 

I'll start with point 2.:

If you want to deploy to Office 2010 AND 2007, you have to add references to the v12.0 assemblies (Microsoft.Office.Interop.Word and Office).

Now there is still the problem that your addin will require the 2007 PIA, but they won't install if you only have Office 2010 on the target machine (because they have Office 2007 as a prerequisite). To solve this you have to set Embed Interop Assemblies = true for those two dlls (in the reference properties).

This causes some "weirdness" with Intellisense not finding methods etc., but it should not be a big problem -at least now PIA are not required anymore and your addin will deploy on both 2007 and 2010 (you'll have to take care of the installer as well, but that is a whole other story).

It's a bit of a mess, but if you are working with VSTO I suppose you are used to this kind of stuff :-)

About Point 1.: my guess is that if you want to deploy to 2007 and 2010 you have to do what I described above. This means you have to reference the 2007 assemblies and you won't have access to 2010-specific features.

Francesco De Vittori
Good insight, thx.
WinnerWinnerChickenDinner