Read the complete article on how to convert Word to JSON in C#: https://blog.aspose.com/2022/08/10/convert-word-to-json-in-csharp/
Last active
August 11, 2022 06:25
-
-
Save aspose-com-gists/ef58fb6ce957c1db12c39b7c871ec81f to your computer and use it in GitHub Desktop.
Convert Word to JSON in C# .NET
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
// Load DOC document | |
Document doc = new Document("document.doc"); | |
// Save document in HTML format | |
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html); | |
// Load the HTML file in an instance of Aspose.Cells.Workbook class | |
Workbook book = new Workbook("html_output.html"); | |
// Save as JSON | |
book.Save("word-to-json.json", Aspose.Cells.SaveFormat.Json); |
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
// Load password protected DOC document | |
Document doc = new Document("document.doc", new Aspose.Words.Loading.LoadOptions("mypassword")); | |
// Save document in HTML format | |
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html); | |
// Load the HTML file in an instance of Aspose.Cells.Workbook class | |
Workbook book = new Workbook("html_output.html"); | |
// Save as JSON | |
book.Save("word-to-json.json", Aspose.Cells.SaveFormat.Json); |
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
// Load password protected Word document | |
Document doc = new Document("document.docx", new Aspose.Words.Loading.LoadOptions("mypassword")); | |
// Save document in HTML format | |
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html); | |
// Load the HTML file in an instance of Aspose.Cells.Workbook class | |
Workbook book = new Workbook("html_output.html"); | |
// Save as JSON | |
book.Save("word-to-json.json", Aspose.Cells.SaveFormat.Json); |
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
// Load Word document | |
Document doc = new Document("document.docx"); | |
// Save document in HTML format | |
doc.Save("html_output.html", Aspose.Words.SaveFormat.Html); | |
// Load the HTML file in an instance of Aspose.Cells.Workbook class | |
Workbook book = new Workbook("html_output.html"); | |
// Save as JSON | |
book.Save("word-to-json.json", Aspose.Cells.SaveFormat.Json); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment