# MailMerge: Merge, MergeObject and MergeObjects - When to Use What?

> The MailMerge class provides three merge methods. Merge accepts a DataSet or configuration file with a master table and related sub-tables. MergeObject merges a single business object using .NET reflection on its public properties. MergeObjects processes an IEnumerable collection.

- **Author:** Bjoern Meyer
- **Published:** 2016-02-16
- **Modified:** 2026-07-17
- **Description:** The MailMerge class provides three merge methods. Merge accepts a DataSet or configuration file with a master table and related sub-tables. MergeObject merges a single business object using .NET reflection on its public properties. MergeObjects processes an IEnumerable collection.
- **2 min read** (317 words)
- **Tags:**
  - Mail Merge
  - Reporting
- **Web URL:** https://www.textcontrol.com/blog/2016/02/16/mailmerge-merge-mergeobject-and-mergeobjects-when-to-use-what/
- **LLMs URL:** https://www.textcontrol.com/blog/2016/02/16/mailmerge-merge-mergeobject-and-mergeobjects-when-to-use-what/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2016/02/16/mailmerge-merge-mergeobject-and-mergeobjects-when-to-use-what/llms-full.txt

---

The [MailMerge](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.class.htm) class has three methods to start the merge process. This article explains when to use which method.

[Merge](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.merge.method.htm)
---------------------------------------------------------------------------------------------------------------------------

The method *Merge* has four implementations and is basically used when merging a template with a DataSet or a data source configuration file. When merging with a DataSet, the master table is passed in the *mergeData* parameter.

The master table is used as the base table and all related tables are automatically used for merge blocks and prefixed merge field names.

```
public void Merge(System.Data.DataTable mergeData, bool append);
public void Merge(System.Data.DataTable mergeData);
public void Merge(bool append);
public void Merge();
```

[MergeObject](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.mergeobjects.method.htm)
----------------------------------------------------------------------------------------------------------------------------------------

*MergeObject* has been introduced in version X13 (23.0) to merge all types of business objects of type [IEnumerable](https://msdn.microsoft.com/en-us/library/system.collections.ienumerable%28v=vs.110%29.aspx). While *MergeObjects* (plural) merges a collection of *IEnumerable* objects, *MergeObject* merges a single instance of an arbitrary type into the loaded document template.

*MailMerge* interprets all public properties of the object as table columns and child tables. The object type is analyzed using .NET reflection and used as the basis of the table structure. Nested object types are used for merge blocks and prefixed merge fields.

```
public void MergeObject(object mergeData);
```

[MergeObjects](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.mergeobjects.method.htm)
-----------------------------------------------------------------------------------------------------------------------------------------

This method merges a collection of type [IEnumerable](https://msdn.microsoft.com/en-us/library/system.collections.ienumerable%28v=vs.110%29.aspx) into the template. For each object in the collection, a new document is created or appended to the resulting document.

```
public void MergeObjects(System.Collections.IEnumerable mergeData, bool append);
public void MergeObjects(System.Collections.IEnumerable mergeData);
```

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [MailMerge Class Settings Explained](https://www.textcontrol.com/blog/2019/12/05/mailmerge-settings-explained/llms.txt)
- [Merge Excel Documents into MailMerge Templates using IncludeText Fields](https://www.textcontrol.com/blog/2019/08/13/merge-excel-documents-into-mailmerge-templates/llms.txt)
- [MailMerge: Conditional Table Cell Colors using Filter Instructions](https://www.textcontrol.com/blog/2019/06/06/mailmerge-conditional-table-cell-colors-using-filter-instructions/llms.txt)
- [MailMerge: Using Filters to Remove Unwanted Rows](https://www.textcontrol.com/blog/2019/06/04/mailmerge-using-filters-to-remove-unwanted-rows/llms.txt)
- [MailMerge: Conditional Rendering of Merge Blocks](https://www.textcontrol.com/blog/2018/11/28/mailmerge-conditional-rendering-of-merge-blocks/llms.txt)
- [DataSourceManager: Using the Ready-to-Use Reporting Dialog Boxes](https://www.textcontrol.com/blog/2018/11/27/datasourcemanager-using-the-ready-to-use-reporting-dialog-boxes/llms.txt)
- [Merge Blocks in X16: Filtering, Sorting and Conditional Rendering](https://www.textcontrol.com/blog/2018/11/22/merge-blocks-in-x16-filtering-sorting-and-conditional-rendering/llms.txt)
- [Different Ways to Create Documents using Text Control Products](https://www.textcontrol.com/blog/2017/10/17/ways-to-create-documents-using-text-control-products/llms.txt)
- [ReportingCloud: Uploading Templates Vs. Sending Templates Inside MergeBody](https://www.textcontrol.com/blog/2017/08/02/reportingcloud-uploading-templates-vs-sending-templates-inside-mergebody/llms.txt)
- [MailMerge: Table Headers and Repeating Blocks](https://www.textcontrol.com/blog/2017/08/01/mailmerge-table-headers-and-repeating-blocks/llms.txt)
- [Text Control Provides a Complete Reporting Tool Set to Fulfill Document Work-flow Requirements](https://www.textcontrol.com/blog/2017/05/09/text-control-provides-a-complete-reporting-tool-set-to-fulfill-document-work-flow-requirements/llms.txt)
- [ReportingCloud: Conditional Text Blocks Based on Merge Blocks](https://www.textcontrol.com/blog/2016/11/02/reportingcloud-conditional-text-blocks-based-on-merge-blocks/llms.txt)
- [MailMerge Improvements in X14: Event Arguments and JSON Data Sources](https://www.textcontrol.com/blog/2016/11/01/mailmerge-improvements-in-x14-event-arguments-and-json-data-sources/llms.txt)
- [Web API Test Sandbox Released on ReportingCloud Portal](https://www.textcontrol.com/blog/2016/10/07/web-api-test-sandbox-released-on-reportingcloud-portal/llms.txt)
- [ReportingCloud: New Test Parameter for Document Quota Related Endpoints](https://www.textcontrol.com/blog/2016/10/06/reportingcloud-new-test-parameter-for-document-quota-related-endpoints/llms.txt)
- [ReportingCloud: The MergeData JSON Object Format Explained](https://www.textcontrol.com/blog/2016/10/04/reportingcloud-the-mergedata-json-object-format-explained/llms.txt)
- [Creating Dynamic HTML Forms Using ReportingCloud](https://www.textcontrol.com/blog/2016/09/28/creating-dynamic-html-forms-using-reportingcloud/llms.txt)
- [MailMerge: Starting Each Merge Block on a New Page](https://www.textcontrol.com/blog/2016/09/09/mailmerge-starting-each-merge-block-on-a-new-page/llms.txt)
- [Creating Reports from QuickBooks or Salesforce Data Sources Using ReportingCloud and CData Cloud Drivers](https://www.textcontrol.com/blog/2016/06/30/creating-reports-from-quickbooks-or-salesforce-data-sources-using-reportingcloud-and-cdata-cloud-drivers/llms.txt)
- [MailMerge: Merging Fields from Child Tables or Related Objects](https://www.textcontrol.com/blog/2016/06/28/mailmerge-merging-fields-from-child-tables-or-related-objects/llms.txt)
- [Preview: JSON Support in MailMerge Version X14 (24.0)](https://www.textcontrol.com/blog/2016/05/18/preview-json-support-in-mailmerge-version-x14-240/llms.txt)
- [MailMerge: The Append Parameter of the Merge Method Explained](https://www.textcontrol.com/blog/2016/04/05/mailmerge-the-append-parameter-of-the-merge-method-explained/llms.txt)
- [MVC: Adding an Electronic Signature to Documents in Web.TextControl](https://www.textcontrol.com/blog/2016/02/18/mvc-adding-an-electronic-signature-to-documents-in-webtextcontrol/llms.txt)
- [MailMerge: Removing Empty Blocks](https://www.textcontrol.com/blog/2016/02/15/mailmerge-removing-empty-blocks/llms.txt)
- [Easy-to-use Sample Templates with Sample XML Data Files](https://www.textcontrol.com/blog/2016/02/10/easy-to-use-sample-templates-with-sample-xml-data-files/llms.txt)
