2

I've seen tons of posts and sites that address this issue. I've tried every solution I've found but none of them work (I've been trying to figure this out for days now). I have seen many posts with the same exact sounding issue, but either the solution didn't work for me or isn't applicable. With that said...

I have an add-in for Outlook 2007 that is intended to add text to the an email's title and body. It is installed for all users using an .msi file. There is an older version that I deployed last year that works fine. The new version I created has only a few minor input/output changes, nothing major. This new version works perfectly on my development computer in both debug from Visual Studio and from an actual install. However, I can't get it to work on a non-development computer. Here are the details on the program and target computer (development computer and target computer details are the same other than the fact that the target computer doesn't have Visual Studio):

-Using Visual Studio Professional 2013
-Written in Visual Basic
-Target Framework is .NET 4.0
-The add-in is only run once the "send" button on an email is clicked.
-Outlook version is Outlook 2007
-Operating system is Windows 7 Enterprise SP1 32-bit

The problem is that the add-in won't load on the target computer(yes, I know, a bazillion other people have had the same issue). As I said previously, it works fine on my computer in both debug and installed versions. This made me think that the other computer is missing something, so I tried installing the .NET 4.0 framework onto the target computer but it told me that it was already installed. I ran through everything I could think of to get it to work with no avail. Here's how it behaves:

-Installs fine with no errors.
-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Office/Outlook/Addins/EmailMarkTool/LoadBehavior = 3 after installation.
-VSTO_LOGALERTS = 1
-VSTO_SUPPRESSDISPLAYALERTS = 0
-Outlook opens with no apparent errors.
-LoadBehavior = 0 immediately after Outlook is opened.
-Shows up in the Add-ins under "Inactive Application Add-ins."
-Never shows up under "Disabled Add-ins."
-In the "COM Add-Ins" dialog where I can check which add-ins to use, it shows the correct directory and the Load Behavior is "Unloaded."
-The add-in can be checked. When I click "OK" I don't get any errors. When I go back to the Add-ins, it is unchecked and "Unloaded" again.
-Setting the LoadBehavior to 3 doesn't help because it goes back to 0 as soon as Outlook is started again.
-I inserted a try-catch block into the New() function of the add-in that has a MsgBox pop-up and a Throw.
-I get absolutely no errors anywhere.
-No log file is generated.

I have tried uninstalling, rebuilding, and reinstalling multiple times all with the same result. I just can't figure out why it will work on my development computer but not the target computer. Thanks for reading all of this. I know it's a lot, but I needed to get the details out. Thanks in advance for any input!

[UPDATE]: I just created a brand new minimal add-in just to test if it would work but got the same results.

ajlampman
  • 33
  • 6
  • Not sure if you looked at this http://stackoverflow.com/questions/4668777/how-to-troubleshoot-a-vsto-addin-that-does-not-load but it might help. – Jim Hewitt Jun 28 '16 at 16:17
  • @JimHewitt Yes, I read that one several times. My add-in has never shown up in the disabled add-ins. – ajlampman Jun 28 '16 at 16:24
  • I'm guessing you've seen this also https://www.outlook-apps.com/inactive-outlook-add-ins/, but just in case, there is a section on "Enabling inactive Outlook add-ins that keep being unloaded:. – Jim Hewitt Jun 28 '16 at 16:39
  • @JimHewitt Yup, as stated in the description, I tried that a bunch of times. – ajlampman Jun 28 '16 at 16:51
  • Since I am about to deploy an Excel VSTO add-in, your issues are of interest to me. One thought, could this be specific to Outlook security? Found this https://msdn.microsoft.com/en-us/library/1thd35d7.aspx. Also, was the minimal add-in you created also Outlook? Wondering if it's worth the effort to try and deploy a minimal Excel add-in just to see if it works. – Jim Hewitt Jun 29 '16 at 19:38
  • @JimHewitt If this was a new project, I would think you might be on to something. However, my further testing has led me to believe that the problem does not lie in my code. The minimal add-in I created does nothing other than have a message box pop up when outlook is started. That requires no special permissions. I also tried re-installing the old version of the add-in I'm trying to update (which I know works; we've been using it for months). Both of them work on my computer but have the same behavior I described in the main article when installed on another computer. – ajlampman Jun 29 '16 at 20:16
  • I guess what I meant was the Outlook security on the target. Not sure if your using Exchange Server or not. Could well be a result of a security patch applied over past year. If the older version no longer works, it might indicate trust settings on the target have changed. – Jim Hewitt Jun 29 '16 at 20:27
  • Just thought of something else. Did you check event viewer on the target? Kind of a long shot, but easy enough to do. – Jim Hewitt Jun 29 '16 at 20:37
  • Thanks for the suggestion. I didn't see anything obvious in the event viewer. I'm thinking that you are right and the problem is outlook security (we are using Exchange Server). I've contacted our system administrators to see if they have any ideas. – ajlampman Jun 30 '16 at 13:46

2 Answers2

1

I found the problem!

The problem may be unique to Outlook 2007. It turns out Microsoft Office 2007 SP1 and SP2 had a bug that prevented it from running VSTO addins. Microsoft released a hotfix that fixes this issue (https://support.microsoft.com/en-us/kb/976477). This was added in to the release of Microsoft Office SP3. However, to activate the fix, a new registry flag must be created but that isn't automatically done with the fix, making the fix useless until you manually activate it (instructions and download here). So...

To enable VSTO addins in Outlook 2007, you have to add a subkey to this registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\General\ and add a DWORD "EnableLocalMachineVSTO" with the value set to 1.

I did this, restarted the computer for good measure, installed my addin for the 23rd time, and it installed and ran perfectly! I'm not sure how previous versions worked, though. It's possible that our system admins removed that subkey in an effort to bolster security at some point.

ajlampman
  • 33
  • 6
0

The loadbehaviour key problem you are experiencing is strange. Whilst I think this is probably not your solution, it could be, so its worth a try.

The target computer will need to have VSTO tools for office runtime installed. You can download these tools are the following link - https://www.microsoft.com/en-GB/download/details.aspx?id=48217

Ross Meikle
  • 259
  • 3
  • 18
  • I thought of that, too. I tried manually installing VSTO runtime but I got a message saying it was already installed. It makes sense, considering that we have add-ons running on all of our computers. I just can't get this new one to work. – ajlampman Jul 18 '16 at 20:05
  • 1
    Try adding a Resiliency key to the registry which will tell outlook to always load and enable the add in. HKEY_CURRENT_USER / Software / Policies / Microsoft / office / 15.0 / outlook / resiliency / addinlist / ( add string value = 1 here ) The "string value" is the name of your add inas it appears in the project. – Ross Meikle Jul 19 '16 at 08:14