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

Free Support Forum - aspose.com

How to use MailMerge.Execute() processing image



the image in database is binary type(byte[]).

i put it into a DataTable. and then the method MailMerge.Execute() is used.
at the same time, System.Byte[]] come to my word document.

the picture, not the "System.Byte[]] " is needed.

So i ask you for help. thank you so much!

Hello

Thanks for your inquiry. Please see the following link to learn how to insert an image form a database during MailMerge:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-insert-images-from-a-database.html

Hope this helps.

Best regards,

"Cannot use Photo field in Aspose.Word demo because it contains an OLE object but we need just an image hence this field."


how can we use OLE object(Photo) if we do not have an image(PhotoBLOB) in Oracle?

Hi

Thanks for your request. Unfortunately, it is not quite clear for me what your problem is. Could you please describe your issue more specifically and provide sample code here for testing? I will check the issue on my side and provide you more information.

Best regards,

Hi
thanks for your answer,i just get what i want by Comparative experiments.

Hi there,

Thanks for your inquiry.

I'm afraid it's still not quite clear what the issue is. Could you please attach your image or document that are having troubles with?

Thanks,

word document need to insert picture, i use the example as you told.


doc.MailMerge.ExecuteWithRegions(dataReader, “Employees”);

but also i want to use the ms-word domain {IF order>=100 “Thanks” “The minimum order is 100 units”}

my usage is as follows:

{IF OPERATION_TYPE_PASSENGERS = “y” “■” “□”}

the var OPERATION_TYPE_PASSENGERS can not be replaced by the data from IDataReader dataReader = cmd.ExecuteReader();

so could you help me change the code?

Hello

Thank you for additional information. In your case you should use the following IF construction:

{ IF { OPERATION_TYPE_PASSENGERS \* MERGEFORMAT } = "y" "" ""} \* MERGEFORMAT }

And this simple code:

Document srcDoc = new Document("C:\\Temp\\in.docx");

srcDoc.MailMerge.Execute(new string[] {"OPERATION_TYPE_PASSENGERS"}, new string[] {"y"});

srcDoc.Save("C:\\Temp\\out.docx");

Please see the attached input and output documents.

Best regards,