Hi,
My client has a need to extract all the text displayed in a Word document, regardless if it’s from an OLE object. Is the best method to save each object separately using the OLEFormat.SuggestedExtension, then extract each object’s text? I was hoping that I could get the displayed text from an xls file through the OLEFormat object.
On a related note, I’m not able to access the underlying excel file for an embedded chart in my Word document. How do I do this?
Thanks for your inquiry. Content of embedded OLE objects is represented as image in the document. So there is no way to get displayed text. The only way to get text of the OLE object is extracting the object from the document and extraction text from it.
Best regards,
Thanks for the reply, but I was referring to the missing OLE object.
Attached is a word document with an embedded chart. I should be able to access/save the underlying Excel file using the NodeCollection, but for the attached file the NodeCollection.Count = 0.
Here is my code. Please note that I’ve been able to access/save other OLE objects successfully.
Dim colShapes As Aspose.Words.NodeCollection = awdDoc.GetChildNodes(Aspose.Words.NodeType.Shape, True, False)
For Each objShape As Aspose.Words.Drawing.Shape In colShapes
If objShape.HasImage Then
Select Case objShape.ShapeType
Case Aspose.Words.Drawing.ShapeType.Image
'…
Case Aspose.Words.Drawing.ShapeType.OleObject
If objShape.OleFormat IsNot Nothing Then
Dim strExtractedPath As String = "C:\BlackIceTemp" & intImage.ToString() & strOleExt objShape.OleFormat.Save(strExtractedPath)
End If
End If
End Select
ElseIf objShape.IsWordArt Then
'…
End If
Next
Thanks for your request. What you are asking for is not actually OLE objects. This is the data of OOXML Diagrams and Charts. MS Word stores data as excel documents inside DOCX document. We will consider adding ability to access data of OOXML Diagrams and Charts. I linked your request to the appropriate issue. You will be notified as soon as it is resolved.
Best regards,
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.