We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Embedding Excel files into Word

Hello,

I use XLSIO to generate Excel files and I need to put them as embedded OLE object (OleLinkType.Embed) to Word document.
Is this possible to do that by DOCIO? If yes how to do it?

In samples I've found coping oleobject (PDF) already embedded in one Word to another Word. It is possible to replace content of copied oleObject with Excel and change a caption?

Thanks,
Adam



3 Replies

RA Rajendran Syncfusion Team October 21, 2010 11:38 AM UTC

Hi Adam,

Thank you for using Syncfusion products.

We have prepared a sample based on your requirement to embed Excel files into the word document. Please do find the sample from the attachment.

Regarding Caption:
Currently DocIO does not have the support for caption.

For further reference please refer our online documentaion from below link:
http://help.syncfusion.com/ug_83/Reporting/DocIO/ASP.NET/default.htm?turl=Documents%2Foleobject.htm

Please try this and let us know if you have any other questions.

Regards
Rajendran




F96988_ebed1d8.zip


AD Administrator Syncfusion Team October 22, 2010 09:50 AM UTC

What I need is embedded link to object. In word document there should be icon (link to embedded file to Word doc), when user click on it, separate window (Excel, Acrobat Reader) should be displayed.

I've achieved this by changing 121 line of attached sample
from:
doc.LastParagraph.AppendOleObject(@"..\..\Data\NorthwindTemplate.xls", pic, OleObjectType.Excel_97_2003_Worksheet);

to:

doc.LastParagraph.AppendOleObject(@"..\..\Data\NorthwindTemplate.xls", pic, OleObjectType.Package);

Everything is fine. In generated Word document I can see an icon with embedded object(XLS file) but then I click on it and close opened (Excel) window, icon disappears from Word document. What's more if you save the opened word document (Save as .. option) and open it you cannot open embedded document again. I use Office 2003 SP3.

Please have a look attached sample.doc

Thanks,
Adam




Sample_33cbaf90.zip


PR Poornima R Syncfusion Team October 29, 2010 11:46 AM UTC

Hi Adam,

Thank you for your interest in Syncfusion Products.

Regarding the issue "I click on it and close opened (Excel) window, icon disappears from Word document", this issue has been already fixed in our latest trunk. Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Regading the issue "if you save the opened word document (Save as .. option) and open it you cannot open embedded document again", When you open a document that contains an embedded OLE object in Microsoft Office Word 2003 or in an earlier version of Microsoft Word, the OLE object is permanently changed to an image that cannot be edited. Could you please refer the below link for more details

http://support.microsoft.com/kb/938757

Please let us know if you have any questions.

Regards,
Poornima


Loader.
Live Chat Icon For mobile
Up arrow icon