Skip to content

OneNoteConnection error #121

@ikarmus2001

Description

@ikarmus2001

Bug

Unable to find type [Microsoft.Office.InterOp.OneNote.HierarchyScope]

Output:

Convert-OneNote2MarkDown : Unable to find type [Microsoft.Office.InterOp.OneNote.HierarchyScope].
At D:\Nie-gry\OnenoteToObsidian\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown-v2.ps1:1423 char:5
+     Convert-OneNote2MarkDown @params
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-OneNote2MarkDown

Convert-OneNote2MarkDown : at Get-OneNoteHierarchy, D:\Nie-gry\OnenoteToObsidian\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown-v2.ps1: line 568
at Convert-OneNote2MarkDown, D:\Nie-gry\OnenoteToObsidian\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown-v2.ps1: line 1362
at <ScriptBlock>, D:\Nie-gry\OnenoteToObsidian\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown-v2.ps1: line 1423
at <ScriptBlock>, <No file>: line 1
At D:\Nie-gry\OnenoteToObsidian\ConvertOneNote2MarkDown\ConvertOneNote2MarkDown-v2.ps1:1423 char:5
+     Convert-OneNote2MarkDown @params
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-OneNote2MarkDown

Cleaning up...
Exiting.

Expectation

Execute properly.

Discussion

Script starts, writes up configuration (read config example and edited properties)

  • Backed up all my Notes from OneNote dir (standard one, appdata/local)
  • made up my config
  • tried to run script without Pandoc installed which obviously resulted errors
  • downloaded and installed Pandoc, checked versions of win and onenote + word
  • checked Pandoc (cmd pandoc.exe runs properly)
  • rebooted pc
  • error as above

It may be important - I'm running script from VSC powershell, it shouldn't make any troubles, right?

Environment

Win10 Home x64 21H2

OneNote 2016 from Office Professional Plus 2019 (somehow)
16.0.10382.20034, version 1808, compilation 10382.20034 quick-installation

Word 2016 from Office Professional Plus 2019
16.0.10382.20034, version 1808, compilation 10382.20034 quick-installation (same as onenote)

Pandoc 2.17.1.1 (.msi installer, hope it installed properly)

Output of Configuration

Configuration:
dryRun: 1
notesdestpath: D:\Nie-gry\converted_notes
targetNotebook: 
usedocx: 1
keepdocx: 1
docxNamingConvention: 1
prefixFolders: 2
mdFileNameAndFolderNameMaxLength: 128
medialocation: 2
conversion: markdown-simple_tables-multiline_tables-grid_tables+pipe_tables
headerTimestampEnabled: 1
keepspaces: 1
keepescape: 1
newlineCharacter: 2
exportPdf: 1

Output of $PSVersionTable

PS > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1320
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1320
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions