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.
Unfortunately, activation email could not send to your email. Please try again.

OLE Object in word document

Thread ID:

Created:

Updated:

Platform:

Replies:

93836 Apr 7,2010 06:57 AM Apr 9,2010 05:19 AM ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Alban FAVEROT
Asked On April 7, 2010 06:57 AM

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
http://help.syncfusion.com/ug_81/Reporting_DocIO/defaultasp.html
(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





GenererPlainte_c18d2442.zip

Administrator [Syncfusion]
Replied On April 7, 2010 11:26 AM

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.

Sample:
http://help.syncfusion.com/support/samples/DocIO.Windows/F93836/OLE-Obj.zip

Please let us know if you have any other questions.

Regards,
Manigandan

Alban FAVEROT
Replied On April 8, 2010 02:26 AM

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;
document.LastSection.AddParagraph();

// Loads the OlePicture from the file.
WPicture pic = new WPicture(document);
pic.LoadImage(System.Drawing.Image.FromFile(@"C:/Inetpub/wwwroot/Admintool/Pictures/icone_pdf.gif"));
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);



Ole_corrupt_f702510.zip

Alban FAVEROT
Replied On April 8, 2010 04:12 AM

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

Alban FAVEROT
Replied On April 8, 2010 04:25 AM

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 05:19 AM

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.

Regards,
Manigandan

CONFIRMATION

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.

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.

;