开发者

OneNote Bizarreness

Using OneNote 2010 doing some C# interop stuff. Observing some very strange behavior, which I think is intentional but I dont get it.

In onenote options there is a section for save and backup. If you go to the folder for Default Notebook Location in windows explorer and create a directory, it will automatically put a file, "Open Notebook.onetoc2" in the directory.

If you change the 开发者_运维百科Default directory, this no longer works. Not in the NEW default directory, or in the ORIGINAL one.

Strange. Even stranger is that if you create a new notebook in a different location through onenote itself, it also creates the "Open Notebook.onetoc2" file but it is DIFFERENT than the one autocreated. I think this is a bug, and it cost me about 4 hours of work today. Even worse, Microsofts own API does not work with this file. UpdateHierarchy() fails.

Anyone seen this or have any explanation? Or even better how to turn this behavior off? Or where to submit this as a bug?


Okay, figured it out. It was my fault (as usual), somehow I had managed to add the Default Notebook Location (C:\User\username\Documents\OneNote Notebooks) AS a notebook. So anything underneath it is in fact supposed to be a SECTIONGROUP.

While updating my hierarchy, I was setting it to and it pukes.


According to Daniel Hölbling's answer here: http://www.tigraine.at/2009/09/01/howto-get-rid-of-onetoc2-files-using-powershell/ You can delete the "onetoc2" files by first navigating into the correct top-level folder, then performing this Powershell command:

Get-ChildItem -Filter "*.onetoc2" -Force -Recurse | Remove-Item –Force

Make sure that you've closed your OneNote notebook before you do this. Additionally, be warned that this will also delete any legitimate OneNote table of contents, so don't run it above any legitimate OneNote folders!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜