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

# INCLUDEPICTURE associated with a MERGEFIELD

Hi

Thanks for your inquiry. I successfully merged with this image http://challey.com/WTC/wtc_huge.jpg (14MB). Please attach your image and template or create a simple application, which will allow me to reproduce the problem.

Here is my code:

Document doc = new Document(@"Test001\in.doc");
doc.MailMerge.Execute(new string[] { "myImage" }, new object[] { "http://challey.com/WTC/wtc_huge.jpg" });
doc.Save(@"Test001\out.doc");


Best regards,

Hi,
Thanks for the suggestion.

I get a proxy authentication error, which I’ll try to get around tomorrow, just leaving work now.

Mike

Hi,

This is my code:

string[] fieldNames = new string[] { “HeaderICaseNo”, “textbox1” };
object[] mergeData = new object[] { “12345”, File.ReadAllBytes(“c:\tosh.gif”)};

Document doc = new
Document(@"C:\FrontOffice30\Development\DotNetProjects\Web\FrontOfficeWeb\App_Data\LetterMailMerge\Harr_Map_L1.doc");

doc.MailMerge.RemoveEmptyParagraphs = true;
doc.MailMerge.Execute(fieldNames, mergeData);

doc.Save(@"C:\FrontOffice30\Development\DotNetProjects\Web\FrontOfficeWeb\App_Data\LetterMailMerge\MS_Harr_Map_L1.doc",
SaveFormat.Doc);


I have attached a Zip file containing
the Word template, the tosh.gif image, the resulting merged DOC and a
screenshot showing the memory error.

Thanks,
Mike

Hi Mike,

Thank you for additional information. But again, the image seems to be corrupted. When I try to open it using Windows Photo Viewer, it does not display the image, but only the following error message: “Windows Photo Viewer can’t open this picture because the file appears damaged, corrupted, or is too large”. If I try to insert it into MS Word document using INCLUDEPUCTURE field, it is not displayed. If I try to insert the images into MS Word document using Insert menu, MS Word shows the following error message: “An error occurred while importing this file C:\Temp\tosh.jpg”. Summarizing all this, I suppose the image is corrupted.

Best regards,

Hi Alexy,

I have found the source of the problem.

I use Paintshop Pro for working with images and it appears that the memory errors occur in images that I have saved with this software. Images that I right click and save from the internet work fine regardless of size. Why this is the case I don’t know, in Paintshop Pro I use JPG and GIF and the images view OK in IE.

Anyway, I am sorry to have wasted your time.

Thank you,
Mike

Hi Mike,

It is perfect that you found the resound of the problem. Most likely Photo Shop uses some non-standard codec for these images. I think, you can change this in save options of the image.

Best regards,