Trying to use aspose.words to create a document via merge. The merging works but the header is getting messed up. The first header is removed and the subsequent headers are repeated horizontally. Thoughts?
thanks,
Chad Boyer
Trying to use aspose.words to create a document via merge. The merging works but the header is getting messed up. The first header is removed and the subsequent headers are repeated horizontally. Thoughts?
thanks,
Chad Boyer
Hi Chad,
Not sure if it applies because I already read it.
Hi Chad,
I have tried the code in that post and it just removes the header completely because there is no previous item to link to.
A couple of extra points.
Hi Chad,
<span style=“font-size:
10.0pt;font-family:“Courier New”;color:#2B91AF;mso-no-proof:yes”>Document<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”> doc = new Document(MyDir
string[] fields = doc.MailMerge.GetFieldNames();
//Create DataTable for mail merge
DataTable dt = new DataTable();
foreach (string column in fields)
{
if (dt.Columns.Contains(column) == false)
dt.Columns.Add(column, typeof(string));
}
//Create three rows
for (int rows = 0; rows < 3; rows++)
{
object[] array = new object[dt.Columns.Count];
for (int i = 0; i < array.Length; i++)
{
array[i] = dt.Columns[i].ColumnName + "_" + i;
}
dt.Rows.Add(array);
}
doc.MailMerge.Execute(dt);
doc.MailMerge.DeleteFields();
doc.Save(MyDir + "Out.pdf");
So the resolution we found was that the header was in a .dotx format and when we changed it to .jpg we got the same output file that you got. When we were doing it before the first page header was ignored and the other pages carried throughout.
Hi Chad,