When outputting HTML by splitting it, the "-tocout" option is used to output the table of contents created by Word's table of contents function as separate HTML files. This is an example of how to load this HTML file (toc-inc.html) into each of the split HTML files using JavaScript.
Parameter/Value |
Description |
Note |
---|---|---|
-split [n] |
Split HTML output separated by headings or paragraphs with specified outline levels 1-3 in a Word document. The [n] following the space specifies outline level 1-3. Split output at the specified outline level. |
All upper outline levels are also split. |
-tocout |
When HTML is output in separate HTML files, the table of contents created by the Word table of contents function is output as a separate HMTL file (toc-inc.html). |
|
-js |
Specify the JavaScript to be used. Specify "-js" followed by a space and the URL or path of the js file. |
|
$(function(){
$(".toc-wrap").load("./inc-toc.html");
});
Example of converting "sample01.docx" in the "sample" folder on the desktop to HTML.
Word2HTML.exe %USERPROFILE%\Desktop\sample\sample01.docx %USERPROFILE%\Desktop\sample\sample01.html -js https://code.jquery.com/jquery-3.7.1.min.js -js inc-toc.js -split 1 -tocout
* This JavaScript will not work on your local PC; you must either upload it to a web server and access it from a web browser, or configure your web browser if you wish to run it on your local PC.
Awards
Contact
Privacy Policy | © 2025 Antenna House, Inc.