Last active
October 10, 2020 07:58
-
-
Save GroupDocsGists/3ebe23286748c319a6b5429b1bda9696 to your computer and use it in GitHub Desktop.
Embed Document into Excel Spreadsheet as OLE Object 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
// Embed Word Document into an Excel Spreadsheet as an OLE object | |
int pageNumber = 1; | |
OleSpreadsheetOptions oleCellsOptions = new OleSpreadsheetOptions("document.docx", pageNumber); | |
oleCellsOptions.setRowIndex(2); // Set row & column number of Spreasheet to embedded document | |
oleCellsOptions.setColumnIndex(1); | |
// Import the Word document into Spreadsheet | |
Merger merger = new Merger("spreadsheet.xlsx"); // Source Spreadsheet | |
merger.importDocument(oleCellsOptions); | |
merger.save("output-spreadsheet.xlsx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment