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

Categories

0 votes
824 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 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...