Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RavHilton opened this issue Jun 20, 2024 · 1 comment
Open

Comments

@RavHilton
Copy link

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
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant