0

Locally, I have several OneNote notebooks in the OneNote 2007 format. For reasons out of scope it is difficult to convert them to the new format first.

I want to be able to send a copy of the notebook to OneNote Online so that I can read-only it from wherever OneNote Online is accessible.

Programmatically, I have used the OneNote desktop API to export a page as an MHT file. Then I have used further code to convert the MHT to an HTML file. Finally, I then used MS graph explorer (because I haven't written that part of the code yet), to create a new OneNoteAPI page with the HTML that I exported.

I had expected the resulting page in OneNote Online to look like the HTML I had just uploaded.

It .. did not.

a) Where before I had a nice OneNote list with checkboxes I now had them laid out vertically. So checkbox\nitem\ncheckbox\item. b) The title box that was exported as part of the HTML .. remained in its place and the new page did not absorb it into its title box.

So, how can I programmatically send a page from a desktop OneNote to a OneNote Online folder and have it look the same?

NB: I actually want to send the entire notebook but am trying one page at a time. NB2: I cannot port all the notebooks to OneNote online once off and then just use that. They need to live in the local network. NB3: I suppose I could just set up an FTP site with the HTML pages that I just exported - that is plan Z.

Thank you

Peter pete
  • 704
  • 1
  • 7
  • 17
  • Can you convert the HTML page to a PDF and upload that using the API? – codeye Apr 13 '19 at 15:08
  • Once a PDF I can upload that anywhere I guess, but ... I am not sure that the API will absorb it as a normal onenote document. – Peter pete Apr 14 '19 at 22:40
  • POST https://graph.microsoft.com/v1.0/me/onenote/pages will embed the pdf as a bitmap image so the text will not be selectable. If the copy is read-only that might be acceptable? – codeye Apr 16 '19 at 12:24
  • Fascinating. I can give that a go. It would have saved time in hacking up a MHL to HTML converter. – Peter pete Apr 23 '19 at 03:28

0 Answers0