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

Free Support Forum - aspose.com

Images in a table

How do I need to set up my word document so I know where to put my image. Do I put just a merge field with a specific name, bookmark, or something else? Then for the code I see I need to

    ’ Set up the event handler for image fields.
doc.MailMerge.FieldMergingCallback = New HandleMergeImageFieldFromBlob()

Next I need to call the handler for the image in my table
’ The field value is a byte array, just cast it and create a stream on it.
Dim imageStream As New MemoryStream(CType(e.FieldValue, Byte()))
’ Now the mail merge engine will retrieve the image from the stream.
e.ImageStream = imageStream

Yet do I need to keep calling this method for each image I have?

E:\myDMA_Documents\35f9098c732f47c78b9d291ba3ecd75a.dma
E:\myDMA_Documents\00981f8e69414b4b9735808165dc1385.dma
E:\myDMA_Documents\a3ba43a4a0de4e57bb3e5f548b07d07b.dma
E:\myDMA_Documents\c673d2515b9c40648ada95e0b4db5113.dma
E:\myDMA_Documents\b8ef0f0355ff41dd913dc2d98650024f.dma
E:\myDMA_Documents\660d0061016f4e29a3954162c3547ed8.dma
E:\myDMA_Documents\106f195042d541cfbdaa03a8eb38d508.dma
E:\myDMA_Documents\5991ac39d48f46d9a210b9fdf112f3b7.dma
E:\myDMA_Documents\a0204df9de0f49898065cf2b7e6501e0.dma
E:\myDMA_Documents\e1b9c0d0594e44f5b60f0509d426b277.dma
E:\myDMA_Documents\236f802949144422a63a1e45ab64574a.dma
E:\myDMA_Documents\f0bb3666aa564d9f94a00275c1d7cafe.dma

These images come back from the database.

In my word document you will see the image (“NO IMAGE FOUND”)
which is the image that I would replace or insert into the
table for each location. Each location record would have one
image in the final document, whether it be the no image found
or an actual image from the location.

Hi,


Thanks for your inquiry. I think, you can achieve what you need after reading the article suggested below:
http://docs.aspose.com/display/wordsnet/How+to++Insert+Images+from+a+Database

I hope, this will help.

Best Regards,