Many of the problems with Word 2007 are due to Word’s handling of add-ins. Add-ins are often used to add tabs and groups to the ribbon. As Word opens, it attempts to load each add-in. If something unexpected happens while an add-in is being loaded, Word will react by disabling it. Depending on the severity of the problem, the add-in can be either ‘soft-disabled’ or ‘hard-disabled’.
In this post, I’ll explain how to programmatically fix problems caused when Word disables add-ins. I don’t attempt to determine why Word isn’t able to successfully load an add-in in the first place. However, I’ve watched Word fail to properly start up and blame it on an add-in that has worked without issue for weeks on end. What’s more, after re-loading the add-in, Word and the add-in will work fine for weeks more. So, it may not be a particular add-in is malfunctioning, but that Word’s handling of add-ins generally is flaky.
Microsoft explains the differences between Hard Disabled vs Soft Disabled in a MSDN article at: http://msdn.microsoft.com/en-us/library/ms268871(VS.80).aspx, but I’ll paraphrase here.
Hard-Disabled Add-ins
Hard-disabling occurs when the add-in causes the application (Word) to close unexpectedly. The problem was so serious that Word crashed.
If an add-in has been ‘hard-disabled’ by Word 2007, it will appear in the Disabled Application Add-ins list. To see which add-ins have been hard-disabled, click on the Office Button -> Word Options -> Add-Ins, and scroll down to “Disabled Application Add-ins”.
To manually restore a hard-disabled add-in, first enable the add-in by selecting “Disabled Items” in the Manage menu, clicking Go, selecting the add-in to re-enable, and clicking the Enable button. Then load it by selecting “COM Add-Ins” in the Manage menu, clicking Go, and placing a check in the box next to the Add-In.
Each hard-disable add-in will have an entry in the DisabledItems registry key at:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Resiliency\DisabledItems
The entry name is some sort of hash/random binary value, rather than the name of the add-in. You can look at the hex of each and identify the specific add-in, but programatically re-enabling them is most easily done by deleting the entire Resiliency key. This makes it an ‘all or nothing’ situation.
Disabling adds a binary value for each addin with a name that’s randomly generated. The Resiliency key exists if there is at least one disabled item, but if you re-enable the addin then the Resiliency key and DisabledItems subkey are both deleted. So the presence of the Resiliency key serves as a general test for the existence of disabled items. You can re-enable the addin by deleting the specific binary reg value, or by removing the whole key.
http://help.lockergnome.com/office/Outlook-constantly-disabled–ftopict876175.html
Soft-Disabled Add-ins
Soft-disabling occurs when an add-in throws an unhandled exception, but the application (Word) does not unexpectedly close.
If an add-in has been ‘soft-disabled’ by Word 2007, it will NOT appear in the Disabled Application Add-ins list. It can be enabled by selecting “COM Add-Ins” in the Manage menu, clicking Go, and placing a check in the box next to the Add-In.
When you re-enable a soft-disabled add-in, Word immediately attempts to load the add-in. If the problem that initially caused Word to soft-disable the add-in has not been fixed, it will soft-disable the add-in again, and the box will not stay checked.
When an add-in has been soft-disabled, the LoadBehavior value in the registry will be changed. It seems that this value can exist in either of two locations:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\
A LoadBehavior of 2 = unloaded (this corresponds to an unchecked box)
A LoadBehavior of 3 = loaded (this corresponds to a checked box)
Here’s more information from Microsoft on the various LoadBehavior registry entries.
Restoring disabled add-ins programmatically
Hard-disabled add-ins can be promoted to simply soft-disabled status, by creating and running the following registry merge file to delete the Resiliency key:
Windows Registry Editor Version 5.00 [-HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Resiliency]
By way of example, the key to load the Acrobat PDFMaker Office COM Addin installed with Acrobat 8 Standard would look like:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins\PDFMaker.OfficeAddin] "LoadBehavior"=dword:00000003
By enabling the add-ins you wish to always load through the Word GUI, exporting the Word\Addins registry keys to capture the correct LoadBehavior, and combining those keys with the instruction to delete the Resiliency key, you’ll be able to fix all of your add-in problems and restore Word to a working state with a single click.
A macro to display a message box with all currently loaded COM add-ins
You can use the following macro to display a message box with all currently loaded COM add-ins.
Sub ShowAddins()
'
' ShowAddins Macro
' Display a message box with all currently loaded COM add-ins
'
Dim MyAddin As COMAddIn
Dim i As Integer, msg As String
For Each MyAddin In Application.COMAddIns
msg = msg & MyAddin.Description & " - " & MyAddin.ProgID & vbCrLf
Next
MsgBox msg
End Sub
Source: Some COM add-ins are not listed in the COM Add-Ins dialog box in Word
Forcing add-ins to be disabled by Word
You can cause add-ins to be disabled by forcibly ending the winword.exe process as Word opens. It might require crashing Word a few times, but eventually you’ll get an error:
Microsoft Office Word
Word experienced a serious problem with the ‘[add-in name]‘ add-in. If you have seen this message multiple times, you should disable this add-in and check to see if an update is available.
Do you want to disable this add-in?
[Yes] [No]
If you click Yes, the add-in will be hard-disabled and an entry will be created in
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Resiliency\DisabledItems
I’ve used this method on a number of occasions to test whether my registry file is repairing Word as expected.
An easy way to crash Word is to create a batch file that contains the line TASKKILL /F /IM WINWORD.EXE and run it as Word starts up.
This is helpful, but what about Templates that are being disabled? How does one go about tracking down whether or not a ‘Global template’ is no longer or not getting loaded?
Word > Word Options > Add-Ins > Manage: Templates > Go >
Under the ‘Global templates and add-ins’ section you can check/uncheck which templates are loaded.