I am using Aspose Word to do a mail merge from a datatable. The only trouble is, when I run it (there are about 300 people in the datatable), some of the people are removed and others are duplicated in their place. I have debugged through and checked and the correct information is in the datatable, right up to when I pass it in. I have downloaded the latest version from your site and that hasn't made any difference either.
The code that I am using is as follows:
protected void CreateLabels(DataTable m_search)
{
//Open the template document
Document doc;doc = doc = new Document(Server.MapPath("~/NQTManager/Labels/LabelsTemplate2.doc"));
Please attach the template document you are using. We need it to be able to reproduce the problem. On Aspose forums all attachment are private and visible only to Aspose team members.
That way you fill first cell, move to the next row in your datatable, fill second cell etc.
In your template you were filling the first cell, filling the second cell with the same data and only then moving to second row in your datatable. In the end of the page Aspose MailMerge engine was moving to next row following {Next} instruction in the end of the last cell of your page, and then the engine moved to the next row once more automatically as it was the end of your template and it had to start filling it over again.
Thus, after filling of the template the first two cells were duplicated, and the one between the pages was lost.
Please mind, that the {NEXT} field is not visible in your cells even when you toggle field view by ALT-F9, because the whole text does not fill in the size of the cell. You need to increase row height to make {NEXT} field viewable and then move it to the beginning of the cell. You need to do this operation with all cells except the first.