Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
914 views
in Technique[技术] by (71.8m points)

excel - How to programatically re-enable documents in the MS Office list of disabled files

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)

The question is: How can this re-enabling of documents be accomplished programmatically, without interaction with the gui?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Consolidating previous answers and expounding upon them here.

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.

Each disabled item is stored as a randomly-named key of type REG_BINARY. The format of the byte array is:

  • bytes 0-3 : ??? (perhaps a 32-bit uint type code, 1 = COM Addin)
  • bytes 4-7 : 32-bit uint length (in bytes) for the first string (path)
  • bytes 8-11 : 32-bit uint length (in bytes) for the second string (description)
  • bytes 12-end : two strings of unicode characters, the byte length for each of which is stored in the uints above

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...