Word has a disabled add-ins function (Help | About | Disabled Items).
How do I add an add-in to the disabled list without having to crash the add-in and wait for the error to come up?
|
Word has a disabled add-ins function (Help | About | Disabled Items). How do I add an add-in to the disabled list without having to crash the add-in and wait for the error to come up? | |||||||
feedback
|
This question came from our site for system administrators and desktop support professionals.
|
I was trying to figure out the binary format of the values in the DisabledItems key myself and your post here got me on the right track. I however think the format is a bit different from how you see it, at least in Office 2010. As far as I can tell the format is like this:
I've been able to successfully hard-disable an add-in using the following C# code:
A similar approach can be used to decode the dll path of an existing value like so:
| |||
|
feedback
|
|
According to this MS site, to disable an add-in in word 2007 do the following:
| |||
feedback
|
|
Answering my own question. It's in the registry, under HKCU\Software\Microsoft\Office[version]>\Word\Resiliency\DisabledItems (where [version] is 10.0 for XP, 11.0 for 2003 and 12.0 for 2007). The keys are Binary keys with names of six (random, as far as I can tell) hex characters. The value is: 01,00,00,00,x,00,00,00,y,[path],00,00,[name],00,00,00 x is the number of bytes in the path (including the two terminator bytes) and y is the number of bytes in the name (which a "friendly name"). x+y should be the total number of bytes minus ten. x and y are both in hex. I assume that they are actually DWORDs, but I've only ever needed the LSB. The path is encoded in UCS-2, little-endian, so to give an example, "c:\" is 00,63,00,3a,00,5c Yes, the binary encoding seems to be the awesomely brilliant encoding of "Take a null terminated ASCII string, translate to Unicode, then take the bytes of that and null-terminate the result" Note that x and y are counts of bytes, not characters; there are 2 bytes per character in UCS-2. If you want to block a template (ie a .dot rather than a .dll) then put 00 for y and skip the name element, and the termination (so it ends with three null bytes, not five). | |||
|
feedback
|
|
Note that Eirikur's code works only if the Resiliency\DisabledItems subkey is in place. It looks like Word will add/remove this entire subkey when it disables/enables. So, if you get an exception running the code, you probably need to add the subkey first. (My post here should probably get moderated, it belongs as a comment but I don't have enough points! Bad start) | |||
|
feedback
|