Created
March 18, 2021 01:41
Excel XLSX to Word DOCX in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Workbook object by Excel file's path | |
Workbook workbook = new Workbook("workbook.xlsx"); | |
// Create DOCX save options | |
DocxSaveOptions options = new DocxSaveOptions(); | |
options.setClearData(true); | |
options.setCreateDirectory(true); | |
options.setCachedFileFolder("cache"); | |
options.setMergeAreas(true); | |
// Save as DOCX | |
workbook.save("Book1.docx", options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Workbook object by Excel file's path | |
Workbook workbook = new Workbook("workbook.xlsx"); | |
// Save as DOCX | |
workbook.save("Book1.docx", SaveFormat.DOCX); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment