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

Free Support Forum - aspose.com

Word- Mailmerge to Stream to HTML/Mail with Images

Hello,

i search across the forum for this thema but i found only some code fragments for .NET which don't help me.

Currently i do following...

Document doc = new Document("MyDoc.doc");

doc.getMailMerge().execute(dataSource);

ByteArrayOutputStream os = new ByteArrayOutputStream();

HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.HTML);

options.setImagesFolder(trashDir.getPath());

doc.save(os, options);

docHtml = os.toString();

...no images in "docHtml".

How to get a nice Mail with images? A sample how to do this would be very nice!

Thanks

-klaus

Hi Klaus,


Thanks for your inquiry.

I think, you can use HtmlSaveOptions.ExportImagesAsBase64 property to specify whether images are saved in Base64 format to HTML. When this property is set to true image data is exported directly on the img elements and separate files are not created:

Please let us know if this solves your problem.

Best regards,