How can I create a (VSTO) Office 2007 add-in using VS 2012?
Asked Answered
S

1

33

Visual Studio 2012 does not appear to support Office 2007 (it only has project templates for Office 2010). If I want to create an add-in compatible with Office 2007, do I need to use Visual Studio 2010, or is there a simple way to do it with VS 2012?

If there is a way to do it in VS 2012, are there any restrictions/advantages, etc. in doing so?

Shrapnel answered 5/9, 2012 at 8:2 Comment(0)
H
52

You can get VS 2012 working with Office 2007. First create an Outlook 2010 Add-In and modify the project file (.csproj) so that it will open in Office 2007 and not look for Office 2010 when run.

Here is the project settings change (Outlook example):

Source XPath:

//Project/ProjectExtensions/VisualStudio/FlavorProperties/ProjectProperties/@DebugInfoExeName

Old Value (Office 2010):

DebugInfoExeName="#Software\Microsoft\Office\14.0\Outlook\InstallRoot\Path#outlook.exe"

New Value (Office 2007):

DebugInfoExeName="#Software\Microsoft\Office\12.0\Outlook\InstallRoot \Path#outlook.exe"

After changing this project setting, when you fire up the debugger (F5) it will load the Outlook 2007 application instead of looking for Outlook 2010.


One of the major drawbacks to using VS 2012 for Office development is that deployment is now using InstallShield LE instead of Visual Studio Setup Projects. This is a major shift, but it seems MS is moving away from supporting native installers and letting others manage this burden. WiX is an alternative installer, but I have not tried it out. WiX (Windows Installer XML) still lacks the UI that is present with InstallShield LE or VS 2010 Setup Projects.

The only advantage of using VS 2012 for development is that development IDE is much faster.

Hearty answered 5/9, 2012 at 15:5 Comment(5)
Recently we switched all our VDProj to WiX using add-in expresses converter for VS 2012 support. Add-Inn Express also has a WiX UI Designer now - looks very similar to the VDProj experience of VS.NET. In my experience, Add-In Express support was good at resolving any problems we faced during conversion. I'd recommend the converter path if you are already using VDProj. If you aren't using VDProj, WiX has a steep learning curve, but it's far more capable with support for bundling x86/x64 within the same package.Hearty
Wix is not compatible with building .msi for office add-ins (at least not out of the box). See this issue on their bug list: wixtoolset.org/issues/4337Turfman
@Turfman - the compatibility issue with WiX appears to have been fixed with VS 2013 Update 3 - see issue #3 in the list.Hearty
I notice there are several (3) other "14.0" references in my .csproj file; do they all need to change to "12.0"?...nope, just changing that one instance solved it.Nationwide
doesnt that just change the debug application on development machine, or it also causes addin (installed on client mahcines) to open the old office on client machine?Failsafe

© 2022 - 2024 — McMap. All rights reserved.