Free Support Forum - aspose.com

Does the evalution download skip or miss merge data?

I have created a merged doc and not all the data is being presented, is this part of the trial version?

Cheers

No, the only eveluation verion’s limitation is a watermark in the output document.

The problem that you have is most likely caused by mismatch in merge field names.

I recommend you turn on display of field codes in Word for all fields and check field names there. What you see in “normal” mode between << >> and symbols is not a field name and editing does not change the actual field name. You can see it if you right click on a field and select Update.

Thank for confirming that I did think so.

Okay, I have found the problem, NEXT. I was using a Next field and it was causing the merge to skip whole row in the datasource?

I have sort of fixed it now but each entry is on a separate page, which wasn’t really what I wanted.

I think most of it is down to my lack of word mail merging knowledge, must read up :slight_smile:

NEXT field just moves to the next record in the data source - it does not technically skip it. NEXT is useful in a scenario when you have a table in a document of fixed size and you want to fill it and you don’t want the table to grow. You can fill it cell by cell in a row and then row by row. Just like for printing mailing labels.

If you just use simple mail merge fields and nothing else and your data source has multiple records you will get your whole document repeated for each record - that’s what you are getting now.

The above examples are typical and similar to what MS Word allows to do.

However, Aspose.Word is more advanced than that - we support repeatable mail merge regions. These allow you to grow just part of the document dynamically - repeat it once for each row in your data source. It could be a row in a table or just a fragment of text - the key it will be automatically repeated for every row in the data source.

Note that mail merge regions are not available in MS Word and hence you need to use Aspose “extensions” approach to mark places in the document that designate beginning and end of mail merge regions. You do this by inserting mail merge fields with special names: MERGEFIELD TableStart:MyTableName and MERGEFIELD TableEnd:MyTableName. Then you use one of MailMerge.ExecuteWithRegions() methods that recognize regions and grow content of the regions dynamically.

There is more info in other postings and also in the API documentation. Let me know if you need more pointers or if you are missing something.

Also please see source code and documents for the online demo - there is an example how to use mail merge regions.