OleObjectType equivlent in Aspose Words

Hey, the Aspose.Slides namespace contains a very useful OleObjectType
enum that classifies the type of OLE embedded objects. This is accessed
via the OleObjectFrame.ObjectType property.

This enum (or an
enum of similar purpose) does not exist in the Aspose.Words
namespace. I imagine this would be accessed by a call to OleFormat.ObjectType, but this property does not exist.

Can this functionality be added to Aspose.Words please?


Thanks for your inquiry. You can use OleFormat.ProgId property to achieve the same:
Best regards.

Thanks for the suggestion. Are you able to provide a list of all the possible values that OleFormat.ProgId can take? I fear that simple string equality logic will miss some unusual cases and the logic will be incomplete.

My ultimate goal is to filter the OLE shapes on a page based on their type (ie. Word Document, PDF, Excel Spreadsheet, etc).


Thanks for your inquiry. There is no such list. The ProgID is stored in document binary as string. We just extract it from there. Here are examples of possible values of ProgId:
Best regards.

Thanks for that. Do you know if there is a more extensive list available online?

I’ve noticed the ProgID field is set based upon the default application used to open the embedded OLE file on the computer that adds the file to the document. This leads to some difference in ProgID (ie FoxitReader.Document vs ArchRead.Document for embedded PDF OLEs.

My ultimate goal is to be able to filter out embedded files (Word Documents, Excel Spreadsheets, Powerpoint slides, etc) from other object types (clipart, graphics, charts, etc). Is there any additional information relating to the OLE object that could be exposed to achieve this purpose?


Thanks for your request. As I already mentioned earlier, we just read this value from the Word documents. You are right, ProgID field is set based upon the default application used to open the embedded OLE file.
In one of future version, we will consider an ability to expose the original file name of embedded OLE object. In this case, you will be able to determine file type using file extension.
To determine type of embedded Word documents you can use Document.DefectFielFormat:
Or you can try creating your own methods to determine type of the embedded object. For instance, PDF files always starts with %PDF. Please see PDF specification for more information (section 3.4.1)
Best regards.

The issues you have found earlier (filed as 3257) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.