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

Free Support Forum - aspose.com

OLE object- inserted Object name in word document

Hi,

I am trying to embed external files as Object in Aspose Word document (using version aspose-words-14.9.0-jdk16.

) here is my sample code.



In output of word file file is embedded but file name do not appear which is very confusing to identify embedded file. I am not able to upload the my test files as well as generated word file in this post. Please use your test files to test the code.

public static void main(String[] args) throws Exception{

Document doc = new Document(“C:\asposeTest\blank.docx”);

DocumentBuilder builder = new DocumentBuilder(doc);

boolean isLinked = false;

boolean asIcon = true;

Shape oleObject = builder.insertOleObject(“C:\asposeTest\insertOleTestExcel.xlsx”,isLinked, asIcon, null);



oleObject = builder.insertOleObject(“C:\asposeTest\aspose-cells-8.2.1-java.zip”,isLinked, asIcon, null);



oleObject = builder.insertOleObject(“C:\asposeTest\HLAcrronyms.pdf”,isLinked, asIcon, null);



doc.save(“C:\asposeTest\OLEObjectAsposeTestOutput.docx”);

}

Hi Rita,


Thanks for your inquiry. It seems that you want the file name under OLE. See the attached image for detail. Unfortunately, Aspose.Words does not provide APIs to insert IconCaption while using InsertOleObject. However, we have logged this feature request as WORDSNET-11833 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

If your requirement is different, please share your input and expected output documents here for our reference. We will then provide you more information about your query along with code.

Hi,

I see that there is a notification regarding a release of Aspose.Words that allows the IconCaption to be modified. However I see no mention of the logged issue being fixed in the release notes and no explanation of how to modify the caption. Can someone please shed some light on how to do this in the latest version?

Regards,
Neil

@elneilios

Please ignore the notification message. The issue reported in this thread has not resolved yet. We will inform you via this forum thread once it is resolved. We apologize for your inconvenience.

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.