My macro has some admittedly hackish parts that need to be cleaned up, there is the matter of unsetting variables to be addressed, and it could certainly be made more elegant, but it works. This allows us to tell when an add-in has been disabled and re-enabled it.
Handling disabled add-ins programmaticallyĪ Word macro can access the condition of an add-in via an Application.COMAddIns object, and it can read and write to the registry. I’ve explained a bit about the process by which Word disables add-ins at the end of this post, and I’ve written a shorter post about the basics behind the registry keys responsible for disabling add-ins.
Microsoft explains the differences between Hard Disabled vs Soft Disabled in a MSDN article at: (VS.80).aspx. Depending on the severity of the problem and the user’s response, the add-in can be either ‘hard-disabled’ or ‘soft-disabled’. When something unexpected happens in Word, and Word attributes the problem to an add-in, Word will react by flagging it and prompting the user for a decision the next time Word opens. Many of the problems with Word 2007 are due to Word’s handling of add-ins. It was also a good opportunity to dig a bit deeper into VBA, and I also wanted to confirm that it would work in a more modern environment of Windows 7 and Office 2010 (that code is near the bottom of the post). This month, I decided to rewrite the macro to handle the registry changes and write to the log file.
#Disable microsoft word add in how to#
Nearly a year ago, I wrote a post on how to detect and fix Word add-in problems with a macro and batch file, in a Windows XP and Office 2007 environment.