Hi Aspose team,
I am trying to read SourceFullName of Excel chart inserted into Word document.
When I go to XML structure (word\charts\_rels) I can find for each inserted chart something like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
When I read document with very simple code like:
public void ReadOLE()
{
Console.WriteLine("1. (Word)" + DateTime.Now.ToString());
Aspose.Words.Document doc = new Aspose.Words.Document("1.docx");
Console.WriteLine("2. (Word)" + DateTime.Now.ToString());
{
Console.WriteLine("1. (Word)" + DateTime.Now.ToString());
Aspose.Words.Document doc = new Aspose.Words.Document("1.docx");
Console.WriteLine("2. (Word)" + DateTime.Now.ToString());
//get collection of shapes
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
//Loop through all shapes
foreach (Aspose.Words.Drawing.Shape shape in shapes)
{
foreach (Aspose.Words.Drawing.Shape shape in shapes)
{
if (shape.OleFormat != null)
{
try
{
Console.WriteLine("3. (Word) SourceFullName: " + shape.OleFormat.SourceFullName.ToString());
}
catch (Exception)
{
Console.WriteLine("3. (Word OLE) SourceFullName: NULL");
}
}
else
{
try
{
Console.WriteLine("4. (Word) SourceFullName: " + shape.ImageData.SourceFullName.ToString());
}
catch (Exception)
{
Console.WriteLine("4. (Word ImageData) SourceFullName: NULL");
}
}
{
try
{
Console.WriteLine("3. (Word) SourceFullName: " + shape.OleFormat.SourceFullName.ToString());
}
catch (Exception)
{
Console.WriteLine("3. (Word OLE) SourceFullName: NULL");
}
}
else
{
try
{
Console.WriteLine("4. (Word) SourceFullName: " + shape.ImageData.SourceFullName.ToString());
}
catch (Exception)
{
Console.WriteLine("4. (Word ImageData) SourceFullName: NULL");
}
}
}
Console.WriteLine("5." + DateTime.Now.ToString());
Console.WriteLine("5." + DateTime.Now.ToString());
}
I am jumping to second part with ImageData and then SourceFullName is null.
Btw. why is this not recognized as a OLE object and why there is no reference to XML above where source is found?
Please find attached sample project and test document.