I’ve successfully embedded an OLE object (in my sample case, an .HTML file) into a Word 2010 docx. However, I don’t see a way to add text.
From Word, Insert, Object, Create from File, select file, choose checkbox Display as Icon, clear checkbox Link to file, click on OK. Then the object is nicely embedded, with the default icon, and the file name underneath.
From Java, I have
// Open an existing document.
Document doc = new Document(FOLDER + "Start.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
BufferedImage ieImage = ImageIO.read(new File(FOLDER + "ie.png"));
Shape oleObject = builder.insertOleObject(FOLDER + "ObjectToEmbed.html", false, true, ieImage);
doc.save(FOLDER + "Output.docx");
This works, but I can’t see how I can add text as it done in Word.
Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-12221. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.
Thanks for your inquiry. It is to inform you that issues are addressed and resolved based on first come first serve basis. We have asked from our product team about the ETA of this issue. As soon as any information is shared by them, we will be more than happy to share that with you.
Thanks for your patience. We have fixed the OLE object icon issue in latest version of Aspose.Words for Java 15.12.0. Please use following overloaded DocumentBuilder.insertOleObject method to achieve your requirements.
Regarding file name underneath the icon, we logged this feature as WORDSNET-11833. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.