Yes, it can. I'm using VS2012 for an Excel 2007 project and it works fine.
The trick is to change the debug path in your project file so that VS uses the older version of the Office app your plugin is for.
- Create your VSTO project (let VS create the project for Office 2010)
- Edit the project file and find the
<ProjectProperties>
with a HostName
attribute. It will be a child element of a <VisualStudio>
element.
- Change the
DebuginfoExeName
attribute value of the <ProjectProperties>
attribute to be the path to the older version of the Office application .exe file
- Save your project
Now when you go to debug your app it should launch the older version of your Office app and attach to that process to load your VSTO.
In my project, the new <ProjectProperties>
element looks like this for Excel 2007:
<ProjectProperties
HostName="Excel"
HostPackage="{20A848B8-E01F-4801-962E-25DB0FF57389}" OfficeVersion="14.0"
VstxVersion="4.0"
ApplicationType="Excel"
Language="cs"
TemplatesPath=""
DebugInfoExeName="#Software\Microsoft\Office\12.0\Excel\InstallRoot\Path#excel.exe"
AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}" />
Deployment also works fine. I deploy my add-in via ClickOnce and it is added to Excel 2007 clients without any additional changes.