Hi,
I have developed an .net console application using Aspose.Words API to retrieve any external links used in my word file.
I can able to retrieve all the hyperlinks from the file. But If I use Microsoft Excel Chart, I am unable to retrieve the link.
I have attached the sample file for reference.
Kindly assist to solve the issue.
Regards,
David.
Hi David,
Thanks for your inquiry. Please use OleFormat.SourceFullName property to get or set the path and name of the source file for the linked OLE object. Your document does not contain the worksheet object’s link. Please press Alt + F9 to check this.
Unfortunately, your question isn’t clear enough therefore we request you to please elaborate your inquiry further by providing complete details of your use case. This will help us to understand your scenario, and we will be in a better position to address your concerns accordingly.
Hi Tahir,
Thanks for the response.
My requirement is similar to the below thread
https://forum.aspose.com/t/urgent-how-to-retrieve-microsoft-excel-chart-object-from-powerpoint-file/9638/3
I have developed an .net console application using Aspose.Words API to retrieve any external links used in my word file.
I can able to retrieve all the hyperlinks from the file. But If I use Microsoft Excel Chart, I am unable to retrieve the link.
Regards,
David.
Hi David,
Thanks for sharing the detail. Your input document does not contain the OLE object. It contains drawing object instead. Please unzip your document and check document.xml for detail. See the attached image of document.xml.
Please insert the OLE (excel document) using MS Word from insert tab into your document and press Alt + F9 to check worksheet’s link.
Hi,
My query is not regarding the input doc. My query is how to extract the linked excel file link is associated with Ole objects in the word document.
Regards,
David
Hi David,
Thanks for your inquiry. Please use OleFormat.SourceFullName property to get or set the path and name of the source file for the linked OLE object. We suggest you please read the members of OleFormat.
//Open document
Document doc = new Document(MyDir + "in.docx");
//OLE embedded objects are available through OleFormat property of Shape object
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
//Loop through all shapes
foreach (Shape shape in shapes)
{
if (shape.OleFormat != null)
{
Console.WriteLine(shape.OleFormat.SourceFullName);
Console.WriteLine(shape.OleFormat.ProgId);
Console.WriteLine(shape.OleFormat.SuggestedExtension);
}
}