Thank you for your reply.
My exact use case:
We are a financial service company producing financial research for clients. Our Analysts work out company models in Microsoft Excel and then finally prepare a word document report which is then distributed to clients in form of PDF or word. All charts and tables are copied from excel in docx file as embedded objects. Now, our goal is to convert those documents to HTML to be uploaded on our website. An analyst can have multiple supporting excels for single report.
We tried using Aspose.Cells and were able to retrieve all charts and tables from excel files. We were also successful in creating HTML file by exporting all charts as SVG files and tables in HTML format.
However, the exact sequence of charts and tables required is in form of report in docx file. So, our goal now is to extract all embedded objects from docx file, get the excel path, sheet name and chart/table id/name to exactly retrieve contents from relevant excel files.
Find attached zip sample word and excel file.
I have an Excel sheet with some tables and generated charts out of those tables. I copied some of those charts from Excel to a separate Word file as a Linked chart.
My task is to read all the charts from word file using Aspose.Words and get the reference of those charts from Excel File so that I can convert the Excel chart into an SVG file using Aspose.Cells.
To Read the linked Charts from the Word file and get the reference of its relevant Excel file, I created the following C# function,
public void ReadVectorImages(string docx, string outputDirectory)
{
Aspose.Words.Document doc = new Aspose.Words.Document(docx);
NodeCollection nodes = doc.GetChildNodes(NodeType.Shape, true);
int i = 1;
foreach (var node in nodes)
{
Aspose.Words.Drawing.Shape shapeNode = node as Aspose.Words.Drawing.Shape;
if (shapeNode.HasChart) //Always getting as False, even though it's a chart
{
string str = shapeNode.OleFormat.SourceFullName;
// Some code to process Excel
}
}
}
Through this function, I am getting Excel file path, which is not enough to me, because, I need to get the Sheet Number/ Name and the Chart Name / ID within that sheet to read the Exact chart further through Aspose.Cells.
So, I didn’t find any property or function name to track the same.
My another concern with regards to Aspose.Words is, even though my above function is reading all the shapes from Word files, but it’s property HasChart is always coming as false, even though my docx file has chart. Because of that, I cannot process further to track the Excel file.
Awaiting your advise on above use case and problem explained above.