# MailMerge.Print Method

> Prints the merged document.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 14.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Not in:** `TXTextControl.TextControl.Core.SDK`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer > MailMerge.Print Method
- **1022 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/mailmerge/print-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/mailmerge/print-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/mailmerge/print-method/llms-full.txt

---

### Description

Prints the merged document.

### Syntax

#### Print(PrintDocument)

Prints the merged document. It uses the settings of the specified PrintDocument.

```csharp
public void Print(PrintDocument printDocument);
```

```vbnet
Public Sub Print(printDocument As PrintDocument)
```

| Parameter | Description |
|---|---|
| printDocument | Specifies an instance of the PrintDocument class. Text Control uses the following settings of this object:  \| Setting \| Meaning \| \| DocumentName \| Specifies the document's name. \| \| PrintController \| Specifies the document's print controller. \| \| PrinterSettings.FromPage \| The first page to print. \| \| PrinterSettings.ToPage \| The last page to print. \| \| PrinterSettings.Copies \| The number of copies to print. \| \| PrinterSettings.Collate \| Specifies how the printed pages are sorted. \| \| PrinterSettings.PrinterName \| Specifies the name of the printer. \| \| PrinterSettings.PrintToFile \| Specifies whether the printed pages are saved in a file. \| \| PrinterSettings.PrintRange \| Specifies the range of pages to print. \| \| DefaultPageSettings.Color \| Specifies whether the printed pages are printed colored. \| |
|---|

#### Print(string, string, short, bool)

Prints the merged document with specific settings for the document name, the printer name, the number of copies and whether it should be collated or not.

```csharp
public void Print(string docName, string printerName, short copyCount, bool collate);
```

```vbnet
Public Sub Print(docName As String, printerName As String, copyCount As Short, collate As Boolean)
```

| Parameter | Description |
|---|---|
| docName | Specifies the document's name. |
| printerName | Specifies the name of the printer to which the output is sent. |
| copyCount | Specifies the number of copies to print. |
| collate | Collates output by printing every page of the first copy, then every page of the second copy, and so on. When collate is set to false, the printer prints every copy of the first page, then every copy of the second page, and so on. |

### Examples

The following example prints the current document. The created object is then available to the surrounding document workflow.

```csharp
mailMerge.Print("CustomerName", "CustomerName", 1, true);
Console.WriteLine("Mail Merge is ready for use.");
```

```vbnet
mailMerge.Print("CustomerName", "CustomerName", 1, True)
Console.WriteLine("Mail Merge is ready for use.")
```

---

## Nearby

- **Previous:** [MailMerge.MergeObjects Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/mailmerge/mergeobjects-method/llms-full.txt)
- **Next:** [MailMerge.RemoveEmptyBlocks Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/mailmerge/removeemptyblocks-property/llms-full.txt)
