We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Word for Java: Issue in displaying OLE object(xls) as content from Image

Hi,

I have one word document and I have inserted one xls file (97-2003 version) and choosen the option “Dsiplay the icon”. Now I modify the property to display as content, by setting setOleIcon() as false, using Aspose.
When I open the resulting document I can see the same icon as in source file, instead of content, and on click of the icon attachment is not opening. I get following pop up message “The server application, source file or item can not be found…”.
But when I right click on OLE attachment and then choose following options and then it opens perfectly:
Microsoft office Excel 2003 Worksheet Object-> Convert-> choose option: “Microsoft office Excel 97-2003 Worksheet Object” - > click ok.

Could you please investigate where I am doing any mistake? Also could you please clarify the meaning of display as content and why its not working?
I am attaching the template files (OLE_Doc.doc) and output file (OLE_Updated.doc) and following is the prog used:

// get the first shape node in the document
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
System.out.println("shape prop: " + shape.getNodeType());
//get the OleFormat object
OleFormat oleFormat = shape.getOleFormat();
if (oleFormat != null) {
//display OLE as content
oleFormat.setOleIcon(false);
}
doc.save(“MySystempath/OLE_updated.doc”);
}

Thanks & Regards,
Sanjay Singh

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

Hi,
Please look into this and let me know if you find any solution for this.
We have recently bought license for Aspose.Word Java and doing the development. This issue is very critical for our delivery.

Thanks,
Sanjay

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Currently, I cannot provide you any reliable estimate. Please expect a reply before the next hotfix (within 4-5 weeks).

Also, I noticed that your document is not DOC file, it is actually DOCX document. As a workaround, you can open your document using MS Word and save it in DOC format.

Best regards,

Hi,

There are actually two questions and two separate issues here.

1. The OLE object no longer works after you open/save a document.

I have looked into this and can explain now:

Your original DOC is in fact, not a DOC, but a DOCX file. In that DOCX file your XLS spreadsheet is embedded using not the OLE technology, but the "newer" OOXML embedded package technology.

When you save the document to DOC, Aspose.Words does not support conversion from OOXML Embedded Package to an OLE object.

I will keep this as open issue #11761, but I don't know if this can ever be supported by Aspose.Words. Generally, to work well with an OLE Object, you need to have the real host application. In this case MS Excel and probably MS Word. That's sad, but true if you want to really work with OLE.

I will reply about the other issue in the next reply.

Hi,

Here is the answer to the second part of your requst.

2. Why setting OleFormat.OleIcon (e.g. setOleIcon(false)) does not change the draw aspect of the OLE object?

I have figured out that setting this attribute in the document does not change the way MS Word will display the document on open.

E.g. if you have an Icon, change it to Content and then open the document in MS Word, the object will still always display as Icon. Only when you double click on it to edit the OLE object and then close the host app, MS Word will display the object as Content.

This simply means that Aspose.Words cannot actually change the way the OLE object is displayed because to generate the image of the object (for example the image of an embedded spreadsheet), this really needs to be done by the host OLE application - MS Excel in this case.

To avoid future confusion I will make the OleFormat.OleIcon property read only so it is clear that Aspose.Words cannot change the draw aspect of an OLE object.

The issues you have found earlier (filed as WORDSNET-3032) have been fixed in this .NET update and this Java update.


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