如何以编程方式重新启用 MS Office 禁用文件列表中的文档 [英] How to programatically re-enable documents in the MS Office list of disabled files
问题描述
MS Office 程序会保留一份禁用文件的列表,这些文件在之前打开时导致错误.用户可以通过程序菜单访问列表并选择要重新启用的文档,从而从此列表中删除文档.(http://support.microsoft.com/kb/286017)
MS Office programs keep a list of disabled files that have caused errors when previously opened. A user can remove documents from this list by accessing the list through the program menu and selecting a document to be re-enabled. (http://support.microsoft.com/kb/286017)
问题是:如何在不与 gui 交互的情况下以编程方式完成对文档的重新启用?
The question is: How can this re-enabling of documents be accomplished programmatically, without interaction with the gui?
推荐答案
合并以前的答案并在此处对其进行阐述.
Consolidating previous answers and expounding upon them here.
Office 产品将禁用的项目存储在注册表中名为 HKEY_CURRENT_USERSoftwareMicrosoftOffice
的键下.例如,Excel 2010 的禁用列表位于 HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0ExcelResiliencyDisabledItems
下.
Office products store disabled items in the registry under keys named HKEY_CURRENT_USERSoftwareMicrosoftOffice<version><product>ResiliencyDisabledItems
. For example, Excel 2010's disabled list is under HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0ExcelResiliencyDisabledItems
.
每个禁用的项目都存储为 REG_BINARY
类型的随机命名的键.字节数组的格式为:
Each disabled item is stored as a randomly-named key of type REG_BINARY
. The format of the byte array is:
- 字节 0-3 : ???(可能是 32 位 uint 类型代码,1 = COM Addin)
- bytes 4-7:第一个字符串(路径)的 32 位 uint 长度(以字节为单位)
- bytes 8-11 :第二个字符串(描述)的 32 位 uint 长度(以字节为单位)
- bytes 12-end : 两个unicode字符字符串,每个字符串的字节长度存储在上面的uints中
这篇关于如何以编程方式重新启用 MS Office 禁用文件列表中的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!