Hi Thank you for your reply.
If i have html content it does not render properly.
doc.MailMerge.FieldMergingCallback = new HandleMergeFields();
doc.MailMerge.Execute(
new string[] { "FullName", "Company", "Address", "Address2", "City" },
new object[] { "James\u000a\u000dBond", "<b>ABC</b>", "Milbank", "", "London" });
doc.Save("MailMerge.ExecuteArray_out.doc");
If i use HTML call back code as below HTML its showing properly . But James Bond its not coming in new line. What is the solution for this ? Thanks for your reply .
class HandleMergeFields : IFieldMergingCallback
{
void IFieldMergingCallback.FieldMerging(FieldMergingArgs e)
{
if (e.FieldValue != null)
{
// Create document builder
DocumentBuilder builder = new DocumentBuilder(e.Document);
// Move cursor to field
builder.MoveToField(e.Field, true);
// Insert HTML
builder.InsertHtml(e.FieldValue.ToString(), true);
// Remove the string representation of HTML
e.Text = string.Empty;
}
}
void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs args)
{
// DO NOTHING
}
}