Unable to get source file name of the linked Excel chart

Hello

I am trying to find a source file name of a linked Excel chart in a Word document.
But I could not do it using Aspose.Words. The following is the code I am using.

///////// using Aspose.Words

Document doc = new Document("doc1.docx");
var shapes = doc.GetChildNodes(NodeType.Shape, true);
foreach (Aspose.Words.Drawing.Shape shape in shapes)
{
    var oleFormat = shape.OleFormat;
    if (oleFormat != null)
    {
        if (oleFormat.IsLink)
        {
            var sourceFullName = oleFormat.SourceFullName;
            if (!string.IsNullOrEmpty(sourceFullName))
            {
                Console.WriteLine(sourceFullName);
            }
        }
    }
}
////////

shape.OleFormat is always null.

If I am using VSTO, I can find a source file name by referencing LinkFormat, but Aspose.Words does not have LinkFormat property.

//////// This is part of the code using VSTO
using Word = Microsoft.Office.Interop.Word;
Word.Document doc = Application.Documents.Add("Doc1.docx");
foreach (Word.Section section in doc.Sections)
{
    foreach (Word.InlineShape shape in section.Range.InlineShapes)
    {
        if (shape.LinkFormat != null)
        {
            var sourceFullName = shape.LinkFormat.SourceFullName;
            if (!string.IsNullOrEmpty(sourceFullName))
            {
                Console.WriteLine(sourceFullName);
            }
        }
    }
}
///////

Please see the sample file I am testing. It has a linked Excel chart.
Doc1.zip (15.0 KB)

@valuepro

Your document has not contain the linked Excel document. To insert OLE, please select Object>Create from File option from Insert tab in MS Word as shown in attached image.
insert OLE.png (24.0 KB)

If you open the MS Word document and press Alt + F9, you can view the linked OLE. Please check this image.png (15.5 KB). However, the chart in your document is not linked OLE.

I did not link the whole Excel document. I copied a chart from Excel and pasted into the Word document by selecting “Link & Keep Source Formatting” among the paste options in Word.
I can get the source file name by referencing the InlineShape.LinkFormat.SourceFullName when using VSTO as shown above. But Aspose.Words does not provide LinkFormat property for Shape class.

@valuepro

We have logged a ticket for your requirement in our issue tracking system as WORDSNET-22664. You will be notified via this forum thread once there is an update available on it. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-22664) have been fixed in this Aspose.Words for .NET 22.1 update also available on NuGet.