Is there any way to convert Word document where I have some tables into Excel file? It would be very helpful to convert tables.
Something like that:
- Open Word document using OpenXML
- Find all tables xml-tags
- Copy xml-tags
- Create Excel file
- Insert xml-tags with table from Word to new Excel file
I mean
void OpenWordDoc(string filePath)
{
_documentWord = SpreadsheetDocument.Open(filePath, true);
}
List<string> GetAllTablesXMLTags()
{
//find and copy
}
List<string> CreateExcelFile(string filePath)
{
TemplateExcelDocument excelDocument = new TemplateExcelDocument();
_documentExcel = excelDocument.CreatePackage(filePath);
}
void InsertXmlTagsToExcelFile(string filePath)
{
CreateExcelFiles(filePath);
var xmlTable = GetAllTablesXMLTags();
// ... insert to _documentExcel
}