# MailMergeResult.Workbook Property

> MailMergeResult.Workbook property in the TX Sheet Control .NET API, with its syntax, its type Workbook and a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Property
- **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)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > MailMergeResult > MailMergeResult.Workbook Property
- **1006 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/workbook-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/workbook-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/workbook-property/llms-full.txt

---

### Syntax

```csharp
public Workbook Workbook { get; }
```

### Property Value

`Workbook`.

### 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" } });
    var merged = await invoice.Workbook.Sheets.AtAsync(0);
    await merged.Cell("B3").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    return await invoice.Control.SaveAsync(StreamType.PDF);
}
```

### Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

### See Also

- [MailMergeResult Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/llms-full.txt)
- [Mail Merge With JSON](https://docs.textcontrol.com/tx-sheet-control/mail-merge/overview/llms-full.txt)
- [Workbook Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbook/llms-full.txt)

---

## Nearby

- **Previous:** [MailMergeResult.Metadata Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergeresult/metadata-property/llms-full.txt)
- **Next:** [MailMergeTemplate Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/mailmergetemplate/llms-full.txt)
