none
Problems with Outlook 2007 AddIn while implementing Outlook 2010 support RRS feed

  • Question

  • Hello,

    although I found many interesting posts about this topic none of them answered my question completely. So I open my own post to hopefully get help.

    I already developed an Outlook 2007 AddIn. And now I want this AddIn to support Outlook 2010.

    This origin AddIn was developed on a XP x86 using .NET 3.5 and VSTO 3.0. The AddIn contains a few form regions and customizes the Outlook's Explorer and Inspector windows. In the Explorer window a new commandbar has been added. Some built-in controls (i.e. the "Answer" button) will be enabled oder disabled depending on the currently selected item. The menu has been extended by a few menu items and other menu items (those being automatically added for opening new inspector windows using the installed form regions) in the action menu will be hooked. The Inspector windows for writing and reading email items got new tabs containing my own controls for my form separate regions. Also the menu behind the Office button of both Inspector windows are customized by adding own controls and hooking existing controls. And finally I added a new option page to the Outlook settings dialog.
    The solution contains my AddIn project, five additional projects needed by the AddIn project and last but not least a setup project. The setup project has been developed as suggested for deploying an Outlook 2007 AddIn. That means, it seraches prerequisistes on the target machine and start the according installer if they are not found.

    Now I want my AddIn to fully support Outlook 2010 (both x86 and x64).

    I really tested a lot right now but I did not come to a working solution. Of course installing the Outlook 2007 AddIn on Outlook 2010 works at the beginning using the AddIn tab in the Outlook Explorer. I have to say that I did not test all functionality, yet.
    Using a new developing machine with Windows 7 x64 having Visual Studio 2010 and Office 2010 (x64) installed I first converted my projects. I added a new ribbon for the Explorer and only add my command bar on version 12 of Outlook to the Explorer window. On my developing machine the AddIn works. But installing it on a fresh machine the AddIn will not be loaded. Unfortunately there is no error message shown (and yes, I switched on the addin error messages). Loading the AddIn manually in the trust center writes a line saying that the addin could not be loaded.

    Please let me know if it is possible what I want to do. Or if it is the better way to use different projects for both Outlook versions. I really hope it is possible because I want to avoid supporting two projects having almost 100% the same code. Are there any changes in the event handling in both Outlook version I will have to pay attention for?

    Thanks for reading and answering.

    Mõbius

    Thursday, March 15, 2012 3:56 PM

Answers

  • Hi,

    I just will tell you the latest news.

    My origin point was to add full support for Outlook 2010 (x86 and x64) to my addin created with XP x86 and Visual Studio 2008 for Outlook 2007 and .NET Framework 3.5. My first step was to use a new development machine running Windows 7 x64, Outlook 2010 x64 and Visual Studio 2010 targeting .NET Framework 3.5.

    Because of the described problems in my previous posts I decided to revert to XP x86 and installed Visual Studio 2010 and Outlook 2010. Now I am able to create a setup which can be used with all Windows Outlook combinations. The addin is successfully loaded in any combination.

    I do not know the reason for my problems using Windows 7 x64 as development machine and I honestly do not mind. I found a workaround and I am satisfied now.

    Thanks to all who tried to help me in this case.

    Mõbius

    • Marked as answer by Mõbius Monday, March 26, 2012 12:46 PM
    Monday, March 26, 2012 12:46 PM

All replies

  • If I understand correctly on your development machine with Office 2007 your add-in works fine and on a development machine with Office 2010, your add-in works fine.  However, it will not load onto a non-developer Office 2010 machine.

    Does it load on a non-developer Office 2007 machine?

    Usually, problems associated with loading on non-developer machines has to do with Trust Certificates.  Has your project been signed with a Trust Certificate that can be used on non-developer machines?


    Kind Regards, Rich ... http://greatcirclelearning.com

    Thursday, March 15, 2012 4:36 PM
  • Hi Rich,

    the assembly is not signed. But as far as I know this signature is only required to prevent the installation prompt a user will get after installing the addin.

    But let me specify my post a little bit more. I just re-read the articles that helped me developing the Outlook 2007 addin.

    http://blogs.msdn.com/b/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-i.aspx and
    http://blogs.msdn.com/b/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-ii.aspx

    I mentioned the updated paragraph on top of these articles and followed up to this one.

    http://blogs.msdn.com/b/vsto/archive/2010/03/08/deploying-your-vsto-add-ins-to-all-users-saurabh-bhatia.aspx

    I did not tested it, yet. But may be the registry keys for my Outlook 2007 addin may not work for Outlook 2010. I have to check that.

    Hopefully you also have any ideas about the other aspects of my post let me just summarize my questions (assuming I use my converted solution from XP x86 with VS 2008 and Office 2007 to Windows 7 x64 with VS 2010 and Office 2010 x64 keeping the target .NET Framework version 3.5 and planning to have one MSI file for my customers not knowing what OS or Office version they will use). What prerequisites do I need? Is the following list complete and correct?

    • .NET Framework 3.5
    • VSTO 4
    • Windows Installer 3.1
    • Office 2007 or Office 2010 x86 or Office 2010 x64

    Do I have to differ between the target system prerequisites in any way? I just want to know because most explanations I already found describe the use of .NET 4.

    I know how to add command bars or ribbons depending on the target Office version. But is it possible to enumerate the ribbon controls to hook their actions or to disable them for my needs? With Office 2007 I did not find a way for doing this.

    I just tested some things with hooking elements and found out I still can enumerate all existing commandbars. Is the conclusion that ribbon buttons are only nice designed buttons with commandbar objects in the background? Assuming this accessing all controls displayed on any ribbon would be possible. Or are the commandbar objects marked as deprecated? Than an enumeration of the ribbon controls would be nice.

    A new question just came to my mind which I forgot yesterday. Is it possible to add buttons to an existing group of a ribbon. I.e. to place a button between the "new mail message" and the "new items" buttons in the TabMail tab of the Outlook 2010 Explorer ribbon?

    Great thanks to trying to help me.

    Mõbius


    • Edited by Mõbius Friday, March 16, 2012 9:47 AM Additional information added
    Friday, March 16, 2012 9:04 AM
  • Your plugin most probably registers entry under HKLM and for office 2007 to load add-ins from there (at least VSTO ones) it has to have some hotfix applied. Please verify that your 2007 installation has SP3 or if not, at least those hotfixes (as mentioned in articles that you linked)

    Friday, March 16, 2012 11:17 AM
  • Hello DamianD,

    my Outlook 2007 addin installs fine - no matter of the Office service pack installed. But let me ask another question to clearify my problem. Would an addin be displayed in the "Inactive AddIns" list of Outlook if there are wrong registry entries for the addin? Or additionally would Outlook be able to load the addin when marking the addin in the mentioned list?

    My guess is that there are some prerequisites missing. Therefor I asked about the prerequisite constellation if it is ok as I use it.

    I have to admit that I put a lot of questions in this post but all of them belong to the same issue I am confrontated with.

    Mõbius

    Friday, March 16, 2012 1:41 PM
  • installation is not a problem - lack of required hotfix/service pack will result in silent 'disabling' of your plugin. Of course if your add-in is in Disabled items, you should remove it from there. Inactive items is not a problem - just make sure you have proper hotfix for office and check if VSTOR and PIA are installed on that system.
    Friday, March 16, 2012 2:11 PM
  • Hi again,

    following your advices I checked and installed ALL Office 2007 updates and ALL important (and the most optional) Windows Updates manually from the Windows Update website. And I did some repeated tests.

    Installing on Windows 7 x64 with .NET Framework 3.5, Office PIA 2010, VSTOR4.0 succeeded.
    Installing on Windows XP x86 with .NET Framework 3.5 (SP1), Office PIA 2007, VSTOR4.0 failed silently (AddIn is listed as inactive AddIn).
    Installing on Windows XP x86 with .NET Framework 3.5 (SP1), Office PIA 2007, VSTOR3.0 failed with the following message (AddIn is listed as inactive AddIn after this message).

    The "Microsoft Office Customization Installer" dialog appears. But there is no question whether to install the AddIn or not. There is an error message displayed saying the following.

    Name:
    From: file:///C:/.../MyAddIn.vsto

    The expected element "addIn" was not found in the XML code.

    ********* Exception message *****
    Microsoft.VisualStudio.Tools.Application.Deployment.InvalidManifestException: The expected element "addIn" was not found in the XML code.
         at Microsoft.VisualStudio.Tools.Application.Deployment.ApplicationManifest.FromXml(String manifest, Boolean validate)
         at Microsoft.VisualStudio.Tools.Application.Deployment.ApplicationManifest..ctor(String manifest, Boolean validate)
         at Microsoft.VisualStudio.Tools.Application.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    This message only appears once at startup. The next startup will not show any more messages like this. But opening the "Actions" menu (my AddIn installes three form regions with different message classes) the automatically generated menu items for the form regions will raise this error again - for each form region and each time the same message text.

    I guess that installing VSTOR3.0 instead of VSTOR4.0 will raise this error.

    I also set the EnableLocalMachineVSTO to 1 at HKLM\Software\Microsoft\Office\12.0\Common\General. This obviousely works because the AddIn seems to be loaded and result in an error while loading.

    Any more advices? Is there any log where I can find out more about the load behavior of my AddIn?

    Mõbius

    Tuesday, March 20, 2012 1:20 PM
  • try setting up env variable VSTO_SUPPRESSDISPLAYALERTS and set it to 0. Reenable add-in in outlook and see if you get any error messagebox.

    also write here or post screenshot from outlook Help window where exact version number is shown.

    Tuesday, March 20, 2012 2:41 PM
  • Hi,

    I used the Outlook option to show AddIn errors instead of setting the environment variable and now I get errors. For each form region my addin provides the same error message will be displayed. First the described message above will be displayed and after this the following messages appear - both messages for each form region.

    The form region "MyAddIn.FormRegionX" can not be opened. In the form region manifest an AddIn is given which is not installed.

    The word may vary because I translated the message.

    The Outlook Version is as follows.

    Microsoft Office Outlook 2007 (12.0.6607.1000) SP3 MSO (12.0.6607.1000)

    If you need any more information please let me know. And great thanks for your endurance in that matter.

    Mõbius


    • Edited by Mõbius Tuesday, March 20, 2012 3:58 PM Some corrections
    Tuesday, March 20, 2012 3:56 PM
  • Hi,

    I just will tell you the latest news.

    My origin point was to add full support for Outlook 2010 (x86 and x64) to my addin created with XP x86 and Visual Studio 2008 for Outlook 2007 and .NET Framework 3.5. My first step was to use a new development machine running Windows 7 x64, Outlook 2010 x64 and Visual Studio 2010 targeting .NET Framework 3.5.

    Because of the described problems in my previous posts I decided to revert to XP x86 and installed Visual Studio 2010 and Outlook 2010. Now I am able to create a setup which can be used with all Windows Outlook combinations. The addin is successfully loaded in any combination.

    I do not know the reason for my problems using Windows 7 x64 as development machine and I honestly do not mind. I found a workaround and I am satisfied now.

    Thanks to all who tried to help me in this case.

    Mõbius

    • Marked as answer by Mõbius Monday, March 26, 2012 12:46 PM
    Monday, March 26, 2012 12:46 PM