English Indonesia Tiếng Việt عربي Español Italiano Türk فارسی Français Português Русский ไทย

Create Word Documents with Mail Merge in C#

Streamline your Word document creation process by programmatically generating Word files using Mail Merge technology. The C# API handles all aspects of the Mail Merge operation, helping you save time and ensure maximum accuracy in your results.

Key Features

  • Generation of Word documents based on templates with Merge Field support.
  • Dynamic content insertion, including text, tables, images, and form fields in output Word files.

Use Cases

  • Business Word Documents. Create contracts, proposals, or agreements in Word format with client-specific information.
  • Personalized Word Reports. Create customized Word reports by combining data from databases or other sources.
  • Batch Processing of Word Files. Automatically create hundreds of Word files from a single template with different data sets.

By integrating Wordize Mail Merge capabilities into your .NET projects, developers can create professional solutions for Word document generation and automation. Install our library to try the capabilities of generating customized Word documents in your C# software today.

C#
Run code
Upload your document template
Upload your data source (XML, JSON, CSV)
Select the target format from the list
using System.Data;
using Newtonsoft.Json;
using Wordize.MailMerging;

string json = File.ReadAllText("DataSource.json");
DataTable dataTable = JsonConvert.DeserializeObject(json);
MailMerger.Execute("Input.docx", "Output.docx", dataTable);
using System.Data;
using Wordize.MailMerging;

DataSet dataSet = new DataSet();
dataSet.ReadXml("DataSource.xml");
MailMerger.Execute("Input.docx", "Output.docx", dataSet.Tables[0]);
Run code

How to generate Word files in C# using Mail Merge

  1. Install the C# library for generating Word files using Mail Merge technology.
  2. Add a reference to the library (import the library) in your C# project.
  3. Call the MailMerge method to generate Word through Mail Merge.

System Requirements

Our product is fully cross-platform and supports all major .NET implementations:

  • .NET ≥ 5.0
  • .NET Core ≥ 2.0
  • .NET Standard ≥ 2.0
  • .NET Framework ≥ 3.5
  • MonoMac
  • MonoAndroid
  • Xamarin

As far as .NET code doesn't depend on the underlying hardware or operating system, but only on a Virtual Machine, you are free to develop any kind of software for Windows, macOS, Android, iOS and Linux. Just make sure you have installed the corresponding version of .NET Framework, .NET Core, Windows Azure, Mono or Xamarin.

We recommend using Microsoft Visual Studio, Xamarin, and MonoDevelop integrated development environments to create C#, F#, VB.NET applications.

5%