I just downloaded the Aspose.Word package to test and see if we can do what we want to accomplish.
When trying to figure out how to merge an image into a document I’m getting an error “MergeImageFieldEventArgs is not defined”.
The code I’m using is:
Private Sub HandleMergeImage(ByVal sender As Object, ByVal e As MergeImageFieldEventArgs)
If e.FieldName = “PictureFileName” Then
'You can do a number of things in this event handler, this is just one scenario.
'In our case the field in the database contains a file name (without path information)
'of the image of the product category.
Dim shortFileName As String = CType(e.FieldValue, String)
'We know that the image files are stored in the same folder as the database and
'so we create the full file name.
'Here, we pass the image file name to Aspose.Word mail merge engine.
'Alternatively, we could have passed a .NET Image object or a Stream in
'e.Image or e.ImageStream properties.
e.ImageFileName = System.IO.Path.Combine(MyBase.DatabasePath, shortFileName)
The rest of my regular text merges work but I’m having issues getting the merging of images working.
Any help would be appreciated so we can continue our demo of the product.