Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Mar 17, 2015 4:00 pm

Hello,
I know how to programmaticaly add text in mergeField :
Code: Select all
           
String[] fieldNames = new String[] { "Name" };
String[] fieldValues = new String[] { "Value" };
document.MailMerge.Execute(fieldNames, fieldValues);


But, what I want is to add an image. Is it possible ? If not, how can I insert an image to a pre-defined position (using a word template)?
Thanks

loc
 
Posts: 3
Joined: Tue Mar 17, 2015 3:55 pm

Wed Mar 18, 2015 8:15 am

Hello,

Thanks for your inquiry.
Yes, you can add image in MergeField named like "Image:YourFieldName".
I also provide you a demo, you can check with that.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Mar 18, 2015 8:50 am

Thank you for your answer and your code !
Using your code, I get a "blank" image. Do you know why ?(Please see the attachment)
Thanks

loc
 
Posts: 3
Joined: Tue Mar 17, 2015 3:55 pm

Wed Mar 18, 2015 9:15 am

Edit : I found the answer here : ht tp://wordfaqs.mvps.org/ InvisibleGraphics.htm

Thank you again for your code !

loc
 
Posts: 3
Joined: Tue Mar 17, 2015 3:55 pm

Wed Mar 18, 2015 9:20 am

Hello,

Please feel free to contact us if you have any questions or needs.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Doc