onenote 2007 notebooks batch convert to onenote 2010/2013/2016

你。 提交于 2019-12-12 03:09:30

问题


My customers have roughly 600gb (all together) worth of Onenote 2007 notebooks. Onenote 2016 doesn't allow editting of onenote2007 format notebooks. It requires conversion.

MS doesn't provide a batch conversion utility. MS does provide a notebook-by-notebook conversion via their UI which is clunky. Does anyone know if I could use their Publish API to convert one notebook at a time?

https://msdn.microsoft.com/en-us/library/office/jj680120.aspx#ON14DevRef_Application_Functional (see Publish Method)


回答1:


I gave it a go. You can!

One can use the Publish API method from the Application2 onenote API COM object by opening a 2007 notebook and specifying the export format as PublishFormat.pfOneNote (to export as 2010+ format).

There are some limitations:

  1. You can only convert a section. So your code will have to open the 2007 notebooks, find the sections, and convert one at a time.
  2. Sections that have no pages will result in an error code being thrown. So do check that there are pages in the section before attempting conversion.

So, given the limitations, my conversion app will have to:

  1. Loop through the notebooks in a big folder.
  2. Open each notebook, iterate through each section, and convert each non-empty section into a new notebook folder.
  3. Open the new notebook folder and create into it any missing sections.
  4. Order the sections in the new notebook.
  5. Save and close both notebooks.
  6. Repeat.

Here's a partial implementation: https://github.com/PetePeter/onenoteconverter



来源:https://stackoverflow.com/questions/37233438/onenote-2007-notebooks-batch-convert-to-onenote-2010-2013-2016

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!