Wordize for .NET is a professional solution for automated creation of personalized Word documents using Mail Merge technology. The MailMerger class enables C# developers to merge ready-made document templates with data from various sources for bulk generation of personalized Word invoices, contracts, reports, and letters.
Wordize for .NET provides the ability to use Mail Merge technology with templates in any supported formats. This allows creating personalized Word documents regardless of the original template format.
Functional Capabilities:Test the capabilities of programmatic generation of personalized documents using Mail Merge technology in the interactive online demo presented on this page. Upload a document template, a text file with data (CSV, JSON, XML), run the operation, and download the generated result for verification. The provided C# code snippet is fully ready for use in your .NET project.
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", SaveFormat.Docx, dataTable);
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", SaveFormat.Docx, dataTable);
using System.Data;
using Newtonsoft.Json;
using Wordize.MailMerging;
using Wordize.Saving;
string json = File.ReadAllText("DataSource.json");
DataTable dataTable = JsonConvert.DeserializeObject(json);
var imageStreams = MailMerger.Execute("Input.docx", new ImageSaveOptions(SaveFormat.Docx), dataTable);
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.docx");
stream.CopyTo(file);
}
using System.Data;
using Wordize.MailMerging;
DataSet dataSet = new DataSet();
dataSet.ReadXml("DataSource.xml");
MailMerger.Execute("Input.docx", "Output.docx", SaveFormat.Docx, dataSet.Tables[0]);
using System.Data;
using Wordize.MailMerging;
DataSet dataSet = new DataSet();
dataSet.ReadXml("DataSource.xml");
MailMerger.Execute("Input.docx", "Output.docx", SaveFormat.Docx, dataSet.Tables[0]);
using System.Data;
using Wordize.MailMerging;
using Wordize.Saving;
DataSet dataSet = new DataSet();
dataSet.ReadXml("DataSource.xml");
var imageStreams = MailMerger.Execute("Input.docx", new ImageSaveOptions(SaveFormat.Docx), dataSet.Tables[0]);
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.docx");
stream.CopyTo(file);
}