3

Ok so this is a fresh install of windows 8.1 on a new machine in our office. We installed Office Professional Plus 2013 on it and everything looks rosy. However, I get the following error:

enter image description here

Everything I've researched says that there's a old outlook value in the registry. 9.3, 9.4 etc. However this computer has never had anything but Outlook 2013 on it and every registry value I can find is 9.5.

I am developing an app that pre-writes a standard email we send when we send clients an update. in C# the relevant code looks like this:

string Body = Head + FileList + details + EmailPart + Signature;

Outlook.Application OLapp = new Outlook.Application();
MailItem eMail = OLapp.CreateItem(Outlook.OlItemType.olMailItem); //this is the line that causes the error.
eMail.Subject = "subject";
eMail.To = "";
eMail.HTMLBody = Body; //text created above
eMail.Importance = OlImportance.olImportanceNormal;

eMail.Display();

This works on every machine in the office except this 64bit W8 box. I'm at a loss, I've repaired and reinstalled the Professional Plus 2013 package to no avail. The com object should register on istall, there's no way I've found to register it manually. I've tried targeting X86 in VS to no avail. I've been hammering on this issue for a couple of weeks now so I'm stumped. Has anyone resolved this issue where it wasn't a Value: 9.3/9.4 Registry issue?

Maybe there's a way to do this that doesn't use COM instead using a dll? Anything to get this user off the ground would be helpful. Thank you.

Jongware
  • 22,200
  • 8
  • 54
  • 100
Andrew
  • 81
  • 1
  • 5
  • on the windows 64Bit machine you will have to do 1 of 2 things.. `1.` Right Click on the Project properties and set it to run from `AnyCpu to x86` or `2.` make sure that the .dll has the `CopyLocal=` property set to true also if you want to make sure it really works create a `Dependencies` folder and add that dll to it.. then remove the reference from the references node and re-add it pointing to the sources in the `Dependencies` folder.. this also sounds like you are referencing the incorrect version of the ComInterop Dll for the version of Office you have installed – MethodMan Mar 03 '16 at 20:17
  • Thanks for the suggestion @MethodMan Unfortunately as mentioned in my OP I did target x86 to no avail. In #2 I don't know what .dll you're talking about, If I look at my references I cannot set CopyLocal to true for any of the outlook interloop assemblies as the property is locked. I've tried both an assemblies reference Microsoft.Office.Interlop.Outlook version 15.0.0.0 and I've tried COM Micosoft Outlook 15.0 Object Library Version 9.5. Both methods worked on my local and other machines but not on the box in question. – Andrew Mar 04 '16 at 00:45
  • Related post: [Error accessing COM components](http://stackoverflow.com/q/12957595/993547). – Patrick Hofman May 11 '17 at 11:28

2 Answers2

5

SOLVED!

Thanks to an answer posted here I was put on the right track for finding my solution.

In short the issue is not that there are multiple keys or invalid keys in the registry, it is that there is a key missing in a specific location in the registry. Specifically in HKEY_CLASSES_ROOT\TypeLib\

In long: My error pointed me towards a key {0006001-0000-0000-C000-000000000046} Everything I could find online then pointed towards the key HKEY_CLASSES_ROOT\Interface{0006001-0000-0000-C000-000000000046}

The most common issue is when you have multiple version entries, 9.5,9.4 etc. You have to remove the versions that are invalid. For my issue there was only one version, 9.5.

I searched for other {0006001-0000-0000-C000-000000000046} entries and every one of them only had one version, 9.5

What the answer linked above wanted me to do was to remove invalid versions in HKEY_CLASSES_ROOT\TypeLib{0006001-0000-0000-C000-000000000046} One problem though... the key did not exist. AHA!

I created the key manually using HKEY_CLASSES_ROOT\TypeLib{00062FFF-0000-0000-C000-000000000046} (A key that referenced the MSOUTL.OLB that my program uses) to build out the missing key. (I don't know of a way to copy an entire key in regedit)

Once I had done that I needed to restart the computer, once restarted the program works flawlessly.

Apparently Office365 misses this location during the install. Thankfully I can put this nearly month long plague that started with me questioning my code behind me! Hope this helps someone else in the future!

Community
  • 1
  • 1
Andrew
  • 81
  • 1
  • 5
0

My case was this key: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib{00062FFF-0000-0000-C000-000000000046} had both Win32 and Win64 subkeys defined, while I had only 64 bit Office installed, so deleting Win32 subkey fixed the problem.

Serge
  • 343
  • 5
  • 8