Skip to content

Failed to Convert ... because specified file doesn't exists #167

@med44600

Description

@med44600

Bug

Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file c:\notes\Reprise\docx{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur : Le fichier spécifié est introuvable.
Convert-OneNotePage : Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file
c:\notes\Reprise\docx{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file
c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur: Le fichier spécifié est introuvable.
Au caractère C:\Users\MédéricGUERIN\Downloads\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-v2.ps1:1422 : 257

  • ... onConfigs | Convert-OneNotePage -OneNoteConnection $OneNote -Config $ ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-OneNotePage

Expectation

Conversion from .docx to .md stop because script didn't find docx file even though it exists

Discussion

It is strange because conversion from OneNote to docx works. Docx file is exactly what it should.
The file is correctly named , and the missing file in the error message exists!
It seems to have no length error, no directory error.

The only thing is that i d'ont use VS environnement because I have no other use and it would be heavy for my computer. I run script directly from an admin powershell console. The log file talks about PIA Assembly: could it be the error source? How can i check and correct if it's missing (without installing VS environment :) )?

Environment

-- Start of Logfile --

PS C:\Users\MédéricGUERIN\Downloads\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-master> .\ConvertOneNote2MarkDown-v2.ps1 -Verbose
Configuration:
dryRun: 0
notesdestpath: c:\notes
targetNotebook:
usedocx: 1
keepdocx: 2
docxNamingConvention: 1
prefixFolders: 1
mdFileNameAndFolderNameMaxLength: 60
medialocation: 1
conversion: markdown_mmd-simple_tables-multiline_tables-grid_tables+pipe_tables+task_lists-mmd_link_attributes-raw_html
headerTimestampEnabled: 1
keepspaces: 1
keepescape: 1
newlineCharacter: 2
exportPdf: 1
COMMENTAIRES : L’objet écrit dans le pipeline est une instance du type « Microsoft.Office.Interop.OneNote.Application2Class » de l’assembly PIA (Primary Interop Assembly) du composant. Si ce type expose
des membres autres que ceux d’IDispatch, les scripts écrits pour fonctionner avec cet objet peuvent ne pas fonctionner si l’assembly PIA n’est pas installé.

Notebooks to convert:
Reprise

Converting notebook 'Reprise'... (Ignoring deleted notes)

Building conversion configuration for Reprise [Notebook]
# Building conversion configuration for Nouvelle section 1 [Section]
## Building conversion configuration for 6/9/2022 - Expert-comptable [Page]
## 6/9/2022 - Expert-comptable [Page]
COMMENTAIRES : Uri: https://d.docs.live.net/1f9b287e04932cd7/Documents/Reprise/Nouvelle section 1.one/6/9/2022 - Expert-comptable
COMMENTAIRES : Directory: c:\notes\Reprise\docx
COMMENTAIRES : Directory: c:\notes\Reprise
COMMENTAIRES : Directory: C:\Users\MDRICG~1\AppData\Local\Temp\Reprise\2023-08-02-18-16-42-0695980
COMMENTAIRES : Directory: c:\notes\Reprise\Nouvelle-section-1
COMMENTAIRES : Directory: c:\notes\Reprise\media
COMMENTAIRES : Removing existing docx file: c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx
COMMENTAIRES : Publishing new docx file: c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx
COMMENTAIRES : Converting docx file to markdown file: \\?\c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md
COMMENTAIRES : Command line: pandoc.exe -f docx -t markdown_mmd-simple_tables-multiline_tables-grid_tables+pipe_tables+task_lists-mmd_link_attributes-raw_html -i
c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx -o c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md
--wrap=none --markdown-headings=atx --extract-media=C:/Users/MDRICG~1/AppData/Local/Temp/Reprise/2023-08-02-18-16-42-0695980
Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur : Le fichier spécifié est introuvable.
Convert-OneNotePage : Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file
c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file
c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur: Le fichier spécifié est introuvable.
Au caractère C:\Users\MédéricGUERIN\Downloads\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-master\ConvertOneNote2MarkDown-v2.ps1:1422 : 257
+ ... onConfigs | Convert-OneNotePage -OneNoteConnection $OneNote -Config $ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Convert-OneNotePage


Done converting notebook 'Reprise' with 1 notes.
Cleaning up...
Conversion errors:
Failed to convert page: Nouvelle-section-1\6-9-2022---Expert-comptable. Exception: Error while converting docx file c:\notes\Reprise\docx\{76279337-9B48-0B09-34AF-30DA87D5B196}{1}{E185189248259008087511978443734194607593311}-1662474788.docx to markdown file c:\notes\Reprise\Nouvelle-section-1\6-9-2022---Expert-comptable.md. Exception: Impossible d’exécuter cette commande en raison de l’erreur : Le fichier spécifié est introuvable.
Exiting.

-- End of Log File ---

Configuration:
dryRun: 0
notesdestpath: c:\notes
targetNotebook:
usedocx: 1
keepdocx: 2
docxNamingConvention: 1
prefixFolders: 1
mdFileNameAndFolderNameMaxLength: 60
medialocation: 1
conversion: markdown_mmd-simple_tables-multiline_tables-grid_tables+pipe_tables+task_lists-mmd_link_attributes-raw_html
headerTimestampEnabled: 1
keepspaces: 1
keepescape: 1
newlineCharacter: 2
exportPdf: 1

Output of $PSVersionTable

PS > $PSVersionTable

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions