Closed aisbergde closed 4 years ago
I repaired office, and now it is running, but I get a lot of errors. I will wait it to finish and then I will see. What I see is, something is generated in the target folder.
folders are created, but they are empty. And these are the errors:
#### Urlaubsplus | Suche
Error while publishing file 'Urlaubsplus | Suche' to docx: Ausnahme beim Aufrufen von "Publish" mit 4 Argument(en): "Der RPC-Server ist nicht verfügbar. (Ausnahme von HRESULT: 0x800706BA)"
pandoc.exe: d:\onenote_2_markdown\Urlaub\Urlaub_2020_Winter_Malta\Urlaubsplus___Suche.docx: openBinaryFile: does not exist (No such file or directory)
Ausnahme beim Aufrufen von "GetPageContent" mit 3 Argument(en): "Der RPC-Server ist nicht verfügbar. (Ausnahme von
HRESULT: 0x800706BA)"
In D:\Repos\GitHub\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:141 Zeichen:15
+ $OneNote.GetPageContent($pageid, [ref]$pagexml, 7)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : COMException
Get-Content : Der Pfad "D:\onenote_2_markdown\Urlaub\Urlaub_2020_Winter_Malta\Urlaubsplus___Suche.md" kann nicht
gefunden werden, da er nicht vorhanden ist.
In D:\Repos\GitHub\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:192 Zeichen:19
+ ... ((Get-Content -path "$($fullexportpathwithoutextension).md" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:\onenote_2_ma...plus___Suche.md:String) [Get-Content], ItemNotFoundEx
ception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
Error while renaming image file path references for file 'Urlaubsplus | Suche': Es ist nicht möglich, eine Methode für einen Ausdruck aufzurufen, der den NULL hat.
I restarted Windows, restarted OneNote several times and now ti works. it looks like a communication error between powershell and OneNote
Great to see you figured it out! Hope it helps you.
Hi @SjoerdV, first of all: wonderful work on creating this, it will definitely release me from my onenote lock-in into the world of markdown notes!
I think I'm running into the same issue as @aisbergde. I'm using Office 365 & Windows 10. When I run the Powershell command, I get the following (I copied the example error log of 1 test notebook page called 'Test', which is output in the terminal):
#### Test
Error while publishing file 'Test' to docx: Exception calling "Publish" with "4" argument(s): "Exception from HRESULT: 0x80042006"
pandoc.exe: ..\poging2\Persoonlijk_(web)\Quick_Notes\Test.docx: openBinaryFile: does not exist (No such file or directory)
Get-Content : Cannot find path 'D:\Onenote Migratie\poging2\Persoonlijk_(web)\Quick_Notes\Test.md' because it does not exist.
At D:\Onenote Migratie\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:192 char:19
+ ... ((Get-Content -path "$($fullexportpathwithoutextension).md" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (D:\Onenote Migr...k_Notes\Test.md:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
Error while renaming image file path references for file 'Test': You cannot call a method on a null-valued expression.
I think it's to do with the Onenote version. It seems to go wrong in the part where the .docx is created. I believe the error code 0x80042006
belongs to onenote, stating that something can't be found. When I opened onenote, I also didn't see the export option to a .doxc format.
After reinstalling office, I noticed now that the option to export a Onenote page to a .docx file was available, so my hopes were high, but I still got the same error.
Do you have any suggestions?
ah, the thing that made a difference: I used "../targetdirectory" when I was asked to provide the target directory, but when I used the full path, it worked. Anyhow, thanks for making this!
Great to hear you got it working and found it a useful script @dirkagterhuis, cheers!
When I run I get this error
Windows 10, OneNote is part of the current Office 365 Or should I try the Windows 10 Version? Or should I search for the 2016 Version?