SjoerdV / ConvertOneNote2MarkDown

Ready to make the step to Markdown and saying farewell to your OneNote, EverNote or whatever proprietary note taking tool you are using? Nothing beats clear text, right? Read on!
GNU General Public License v3.0
196 stars 113 forks source link

Unable to find type [Microsoft.Office.InterOp.OneNote.HierarchyScope #31

Open RavHilton opened 1 week ago

RavHilton commented 1 week ago

G'day,

I am running latest Windows 11 and Microsoft® OneNote® for Microsoft 365 MSO (Version 2405 Build 16.0.17628.20006) 64-bit and when I run this script, all I see is the following error:

InvalidOperation: C:\Users\User.Name\Downloads\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown.ps1:50 Line | 50 | … erarchy("", [Microsoft.Office.InterOp.OneNote.HierarchyScope]::hsPage … | ~~~~~~~~~~~~~ | Unable to find type [Microsoft.Office.InterOp.OneNote.HierarchyScope]. 0

RavHilton commented 1 week ago

By the way, all of the steps below had already been confirmed to be correct...

  • Make sure that OneNote is installed, or the Com automation server won't be able to load it.
  • OneNote MUST be Open and running.
  • Make sure that OneNote and powershell are running in the same security context (e.g. run PowerShell as regular user, not as an administrator if OneNote is not running as an administrator)
  • Make sure that you are using the correct PowerShell architecture as OneNote (e.g. x64 if OneNote x64 is running). For me, using just "PowerShell" and not "PowerShell x64" or "PowerShell x86" and not opening as an administrator did the trick.

x64 OneNote, x64 PowerShell, both running as non-admin, OneNote open and synced...