Text/label with embedded OLE Object

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.

I’d be grateful for any hints.

thanks

matt

Hi Matt,

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.

We apologize for your inconvenience.

Is it resolved? Is there a way to add text .

Hi Matt,

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.

Thank you for your patience and understanding.

In fact, I’m quite happy to wait - it was priyanka1012 who bumped the post.

The workaround I’ve used is simply to place text next to the OLE object. It’s not perfect, but achieves the objectives.

Hi Matt,

We will inform you via this forum thread once this issue is resolved. Thank you for your patience.

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Hi Matt,

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.

Document doc = new Document(MyDir + "input.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.moveToDocumentEnd();
builder.writeln();
builder.writeln();
BufferedImage ieImage = ImageIO.*read*(new File(MyDir + "in.jpg"));
builder.insertOleObject(MyDir + "input.html", "htmlfile", true, true, ieImage);
doc.save(MyDir + "Out.docx");

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.

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

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

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for .NET 18.12 update and this Aspose.Words for Java 18.12 update.

The issues you have found earlier (filed as WORDSNET-11833) have been fixed in this Aspose.Words for .NET 20.1 update and this Aspose.Words for Java 20.1 update.