且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用VS 2012创建(VSTO)Office 2007加载项?

更新时间:2023-12-05 21:32:40

您可以在 Office 2007 上使用 VS 2012 .首先创建一个 Outlook 2010加载项,然后修改项目文件( .csproj ),以使其在Office 2007中打开,并且在运行时不查找Office 2010.

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.

这是项目设置更改( Outlook示例):

Here is the project settings change (Outlook example):

源XPath:

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

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

旧值(Office 2010):

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

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

新价值(Office 2007):

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

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

更改此项目设置后,启动调试器( F5 )时,它将加载Outlook 2007应用程序,而不是查找Outlook2010.

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.

使用VS 2012进行Office开发的主要缺点之一是部署现在使用InstallShield LE而不是Visual Studio安装项目.这是一个重大转变,但 WiX是替代安装程序,但我还没有尝试过. WiX( Windows Installer XML )仍然缺少InstallShield LE或VS 2010安装项目中提供的UI.

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.

使用VS 2012进行开发的唯一优势是开发IDE更快.

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