convert html to docx using pandoc
✓ Published0🌍 Public
Aanemochore
Last edited Jun 22, 2016
Created on Jun 22, 2016
This example shows a Windows batch script that converts HTML files to DOCX documents using Pandoc, a universal document converter. The script accepts either a single HTML file or a folder as input, automatically detecting `index.htm` or `index.html` inside directories. It sets the output filename based on the input name, then invokes the `pandoc` command-line tool with the `-o` flag to generate the DOCX file. The script handles file and folder paths separately, checks for the output’s existence, and returns to the original working directory before pausing.
AI-generated description