开发者

Cannot run Visual Studio 2010 Outlook Add-in on machine with Outlook 2007 installed

Problem summary: How to run Outlook 2010 add-ins with only Office 2007 installed

I have 2 machines with Office 2010 and Visual Studio 2010 installed. One PC is Windows 7 64bit; the other machine is WinXP SP3. I developed my first Outlook 2010 Add-in and successfully tested it on each PC.

The the requirement expanded to test this Add-in with Office (Outlook) 2007 and I am having problems.

Here is what I've done so far:

I researched & concluded that Outlook 2010 and Outlook 2007 cannot be installed side-by-side very effectively. Therefore, I un-installed Office 2010 from my Windows 7 PC and installed Office 2007. Then I trie开发者_JAVA百科d to re-build my V-Studio 2010 Outlook 2010 project (same source code as what used to work) and I got a message:

Error 1 - Could not find file 'bin\Debug\Microsoft.Office.Tools.Common.v4.0.Utilities.xml'. CBMI.OutlookAddinV2

I tried another approach:

I started another V-Studio 2010 solution this time choosing the Outlook 2007 add-in template. Then using Windows Explorer I replaced the default ThisAddIn.cs generated by the template with the formerly working version developed before Outlook 2010 was uninstalled and replaced with Outlook 2007.

First new problem with this approach occurs on this line of source code:

 void TaskPane_VisibleChanged(object sender, EventArgs e)
    {
        Globals.Ribbons[inspector].ManageTaskPaneRibbon.toggleButton1.Checked = taskPane.Visible;
    }

Error 1 The name 'Globals' does not exist in the current context C:\Users\john\documents\visual studio 2010\Projects\CBMI.Outlook2007AddinV3\CBMI.Outlook2007AddinV3\ThisAddIn.cs 36 24 CBMI.Outlook2007AddinV3

So I am confused. Ideally, I could develop using the newest software platforms of Office/Outlook/V-Studio 2010 and make an add-in that works on client machines that only have Outlook 2007. Is this possible?


If you can use .Net 4 for the add-in development you are in luck. This will allow you to do version checking in your add-in for features available only in the newer office version.

Check out this VSTO Blog article on MSDN for information on this.

If however you have to use .Net 3.5, then you have to create a 2007 add-in, as it will also work on 2010. Typically the scenario of using the oldest components, as newer versions are backwards compatible, but seldom the other way around.

You can also crate one add-in for 2007 and one for 2010, but this duplicates much of your codebase.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜