alxnbl / onenote-md-exporter

ConsoleApp to export OneNote notebooks to Markdown formats
GNU General Public License v3.0
919 stars 75 forks source link

Script crashes in step 1 #103

Closed FaVorith closed 4 months ago

FaVorith commented 5 months ago

Describe the bug Script let's me perform all necessary selections and then dies during/after step 1 with the following stack trace:

Unhandled exception. System.Runtime.InteropServices.COMException (0x80042005): 0x80042005
   at Microsoft.Office.Interop.OneNote.IApplication.GetPageContent(String bstrPageID, String& pbstrPageXmlOut, PageInfo pageInfoToExport, XMLSchema xsSchema)
   at alxnbl.OneNoteMdExporter.Helpers.OneNoteExtensions.FillSectionPages(Application oneNoteApp, Section section, AppSettings appSettings)
   at alxnbl.OneNoteMdExporter.Services.Export.JoplinExportService.ExportSectionPages(Section section, String pageNameFilter)
   at alxnbl.OneNoteMdExporter.Services.Export.JoplinExportService.ExportNotebookInTargetFormat(Notebook notebook, String sectionNameFilter, String pageNameFilter)
   at alxnbl.OneNoteMdExporter.Services.Export.ExportServiceBase.ExportNotebook(Notebook notebook, String sectionNameFilter, String pageNameFilter)
   at alxnbl.OneNoteMdExporter.Program.RunOptions(Options opts)
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at alxnbl.OneNoteMdExporter.Program.Main(String[] args)

To Reproduce Starting the script on a non-elevated console with OneNote being open. It says: 1 notebook(s) found(s) <<-- there's a typo in the script's output btw, the (s) after "found" does not make sense -Selecting: Number to export: 1 (first and only notebook should be exported) Export format: 2 (Joplin)

Last output before runtime error is then:

--> Found 12 sections and sections groups

Start processing section (1/12) :

Expected behavior Export should be produced without the script dying.

Logs Contains the same like what I posted.

Desktop (please complete the following information):

Additional context I have pages without titles and I'm also using Chinese characters in others, not sure if any of that could be an issue. Thank you for your support :)

alxnbl commented 5 months ago

Hey @FaVorith , such exception is usually caused by a corrupted OneNote installation, or other issues specific to the computer the tool is executed on. Could you try to export on an other computer ?

FaVorith commented 4 months ago

Hi,

Thank you for your quick response and sorry for the delay - I was on holiday :)

Unfortunately I do not have another Windows laptop, but it is ok, I'll manually transfer the Notebooks that I need in the moment.

Have a great week ahead!

Cheers, Fabian

alxnbl commented 4 months ago

Thanks. You can also try to uninstall and reinstall Office. I close the issue.