如何以编程方式重新启用MS Office禁用文件列表中的文档 [英] How to programatically re-enable documents in the MS Office list of disabled files

查看:102
本文介绍了如何以编程方式重新启用MS Office禁用文件列表中的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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_USER\Software\Microsoft\Office\<version>\<product>\Resiliency\DisabledItems的项下将禁用的项目存储在注册表中.例如,Excel 2010的禁用列表在HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Resiliency\DisabledItems下.

Office products store disabled items in the registry under keys named HKEY_CURRENT_USER\Software\Microsoft\Office\<version>\<product>\Resiliency\DisabledItems. For example, Excel 2010's disabled list is under HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Resiliency\DisabledItems.

每个禁用的项目都存储为类型为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插件)
  • 字节4-7:第一个字符串(路径)的32位uint长度(以字节为单位)
  • 字节8-11:第二个字符串(描述)的32位uint长度(以字节为单位)
  • bytes 12-end:两个字符串的unicode字符,每个字符的字节长存储在上面的uint中

这篇关于如何以编程方式重新启用MS Office禁用文件列表中的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆