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

Free Support Forum - aspose.com

Inserting OLEObject inside a Word document

Hello
I would like to dynamically insert OLEObject link inside a Word document and I also would like to set the caption of the icon representing this link. Does Aspose provide a way to do it?
Thanks

Hi
Thanks for your inquiry. Unfortunately there is not way to insert embedded or linked objects. But you can try inserting LINK field. See the following code example:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField("LINK Word.Document.8 \"C:\\\\Temp\\\\in.doc\" \"\" \\a \\f 0 \\p", "doc");
doc.Save(@"Test287\out.doc");

But note that Aspose.Words doesn’t update this field so you should update fields inside the document manually (ctrl+A and F9). Also you can use macro to update fields. See the following link to learn more.
https://support.microsoft.com/en-us/topic/the-filename-field-does-not-automatically-update-when-you-open-a-document-in-word-de2bfb95-d990-1ced-a618-5ac0a2ec1be4
Also you there is no way to specify an icon that will be displayed and its caption.
Best regards.