Excel Chart objects can be linked into Word parent file as:
If the Excel Chart is inserted as Excel Chart Object I can manipulate it using Aspose.Words.
The link to the excel file holding the chart is exposed through Shape.OleFormat.SourceFullName property.
The bookmark of the inserted chart (example: “Sheet1![Child.xlsx]Sheet1 Chart 1”) is exposed through Shape.OleFormat.SourceItem property.
Both properties can be changed, they are read/write properties.
But, if the Excel Chart is inserted as a Graphic object, Shape.OleFormat has the null value, but I can read the link to the excel file from Shape.Chart.SourceFullName property. This property is read-only.
I have two questions for You:
- Can You expose the SourceItem property of the Excel Chart inserted as Graphic object, SourceItem property (example: Shape.Chart.SourceItem), as You do for charts inserted as Excel Chart Object?
- Can You make both properties read/write properties, existing Shape.Chart.SourceFullName and new Shape.Chart.SourceItem property?
I need the ability to manipulate the location and bookmark of the excel chart inserted as a Graphic object just as I can with a chart inserted as an Excel Chart Object.
I am sending You a test application, using Aspose.Words version 22.2.
The zip file contains AsposeWordsTest\TestFile folder.
In it is an Excel file with two charts (Child.xlsx) and a Word file (Parent.docx).
Both of the charts from Child.xlsx are inserted in Parent.docx, one as an Excel Chart Object and the other as a Graphic object.
The test application can scan links for both charts but can modify only the chart inserted as an Excel Chart object.
Here is the test application AsposeWordsTest.
Thanks in advance.