# MailMergeResult Class

> MailMergeResult class in the TX Sheet Control .NET API: Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Implements:** `System.IAsyncDisposable`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > MailMergeResult Class
- **987 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/llms-full.txt

---

Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

### Syntax

```csharp
public class MailMergeResult
```

Interfaces: `IAsyncDisposable`.

### Members

#### Properties

| Property | Description |
|---|---|
| [Control](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/control-property/llms-full.txt) |  |
| [Metadata](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/metadata-property/llms-full.txt) |  |
| [Workbook](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/workbook-property/llms-full.txt) |  |

#### Methods

| Method | Description |
|---|---|
| [DisposeAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/disposeasync-method/llms-full.txt) | Releases this document and its resources. Dispose documents created from it first. |

### Examples

Capture a reusable invoice template, merge customer data into an independent result, and export that result. Dispose each result after all awaited exports finish.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> MergeCustomerInvoiceAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("Invoice for:");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await book.SetMailMergeAsync(new { version = 1, bindings = new[] { new { sheetId = sheet.Id, cell = "B3", path = "customer.name", type = "string" } }, repeatBlocks = Array.Empty<object>() });

    var template = await book.CreateMailMergeTemplateAsync();
    await using var invoice = await template.MergeAsync(new { customer = new { name = "Alpine Design" } });
    return await invoice.Control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Mail Merge With JSON](https://docs.textcontrol.com/tx-sheet-control/mail-merge/overview/llms-full.txt)

---

## In This Section

- [MailMergeResult.Control Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/control-property/llms-full.txt): MailMergeResult.Control property in the .NET API: the independently owned ISheetControl result host, its lifetime and a C# merge and export example.
- [MailMergeResult.DisposeAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/disposeasync-method/llms-full.txt): MailMergeResult.DisposeAsync method in the TX Sheet Control .NET API: Releases this document and its resources. Dispose documents created from it first.
- [MailMergeResult.Metadata Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/metadata-property/llms-full.txt): MailMergeResult.Metadata property in the TX Sheet Control .NET API, with its syntax, its type JsonElement and a C# example.
- [MailMergeResult.Workbook Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/workbook-property/llms-full.txt): MailMergeResult.Workbook property in the TX Sheet Control .NET API, with its syntax, its type Workbook and a C# example.

---

## Nearby

- **Previous:** [LoadResult.Warnings Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/loadresult/warnings-property/llms-full.txt)
- **Next:** [MailMergeResult.Control Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/control-property/llms-full.txt)
