Hi,
Is it possible to do a mail merge with multiple rows in a table?
Thanks
Derek.
Document doc = new Document();
doc.LoadFromFile("sample.docx");
DataTable dt = new DataTable();
dt.TableName = "table";
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("age", typeof(string));
dt.Rows.Add("yesi", "12");
dt.Rows.Add("jack", "15");
DataSet ds = new DataSet();
ds.Tables.Add(dt);
List<DictionaryEntry> list = new List<DictionaryEntry>();
DictionaryEntry dictionaryEntry = new DictionaryEntry("table", string.Empty);
list.Add(dictionaryEntry);
doc.MailMerge.ExecuteWidthNestedRegion(ds, list);
doc.SaveToFile("merge.docx", FileFormat.Docx);