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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OLE Object in word document

Thread ID:





93836 Apr 7,2010 10:57 AM UTC Apr 9,2010 09:19 AM UTC ASP.NET Web Forms (Classic) 5
Tags: DocIO
Asked On April 7, 2010 10:57 AM UTC

Hello, i'm generating Word document using a word template and replacing variables by the text i want.
In this word document i would like to insert other files (pdf,gif..) and be able to see the content directly in the word to print the "order" and all the attachments.

i have try with the code i have found there
(The following code example illustrates how to insert an OLE object in disk to a Word document.) but i have only the icone and the objet is not reachable.

thanks for your help or clue


Administrator [Syncfusion]
Replied On April 7, 2010 03:26 PM UTC

Hi Alban ,

Thank you for your interest in Syncfusion products.

We were not able to reproduce the mentioned issue .We have prepared a sample for testing , kindly have a look at the sample from the below link ,let us know if it helps. If you still face this problem kindly report through Direct Trac with a sample application to reproduce this issue.


Please let us know if you have any other questions.


Replied On April 8, 2010 06:26 AM UTC

Thanks for your update.
In my case it's a ASP.Net website.
I have tried with your code by reading the PDf file and i get an icon and the message is "file is corrupt or no longer available(see screen shot)
The path that is write in the Word is the same path that i use to read the stream. (C:\...) this path exist BUT only on the server itself. do i have to use UNC or a share folder ?

// Adding new OLE Object.
string sFileName = ConfigurationManager.AppSettings["PathAttachements"] + pa.Filename;
document.LastParagraph.AppendText(sFileName).CharacterFormat.FontSize = 10f;

// Loads the OlePicture from the file.
WPicture pic = new WPicture(document);
pic.Width = 20f;
pic.Height = 20f;

Stream stream1 = new FileStream(sFileName, FileMode.Open, FileAccess.Read);

// Adding new OLE Object.
document.LastParagraph.AppendOleObject(stream1, pic, OleObjectType.AdobeAcrobatDocument);


Replied On April 8, 2010 08:12 AM UTC

I was generating a .doc file , and was using Word 2007 to open it."Compatibilite mode" issue ..
now it works by forcing docx .

Replied On April 8, 2010 08:25 AM UTC

Is there a way to have the OLE Object converted (content visible)
AND autosized to be printed ?

it's possible in Word , but would like to have it done to avoid tthe users to do it.

Administrator [Syncfusion]
Replied On April 9, 2010 09:19 AM UTC

Hi Alban,

Thank you for your interest in Syncfusion products.

Currently we do not have the support for the content visibility in the OLE object. We logged this as a feature request and forwarded to our development team .Currently we do not have any immediate plan to implement this feature. Sorry for the inconvenience caused.

Please let us know if you have any further queries.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon