1
votes

I'm looking to create a utility which searches for Office add-ins.

I've located some add-ins I have in my registry, so I think that would be a good place to start, but I couldn't just add the code to find my add-ins as there are hundreds more in the world, I'm stuck trying to find a way to search through the registry, therefore any advice would be much appreciated.

What I have found:

Office add-ins are located in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office so I'm wanting to iterate through that key, to return the values of the Manifest Location, Load Behavior, Description etc.

I'd like some help to point me in the right direction, If I haven't made myself clear enough please comment and I will happily answer your question.

1
IIRC there used to be some sub-directory in the installation directory of Microsoft Office where add-ins could be deployed, too. Perhaps you could scan that directory in addition to (or even instead of) the registry? - stakx - no longer contributing
You could use Registry.GetValue or RegistryKey.GetValue Method to retrieve registry information. Take a look on MSDN: msdn.microsoft.com/en-us/library/… | msdn.microsoft.com/en-us/library/xzxd58z1.aspx - varg

1 Answers

1
votes
using (RegistryKey ExcelLocation = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\Office\Excel\Addins"))

        foreach (string subKeyName in ExcelLocation.GetSubKeyNames())
        {
            // Open the key.
            using (RegistryKey subKey = ExcelLocation.OpenSubKey(subKeyName))
            {
                // Write the value.
                Console.Writeline(subKey.GetValue("Description"));
                Console.Writeline(subKey.GetValue("FriendlyName"));
                Console.Writeline(subKey.GetValue("Manifest"));
            }
        }

This is the closest I'm going to get to retrieving the information about the addins It retrieves the information I wanted to extract from the registry.