# MailMerge.SearchPath Property

> Specifies a directory name where sub-templates and images (for image merging) should be searched. If SearchPath is empty, the root directory is used.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer > MailMerge.SearchPath Property
- **417 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/searchpath-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/searchpath-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/searchpath-property/llms-full.txt

---

### Description

Specifies a directory name where sub-templates and images (for image merging) should be searched. If SearchPath is empty, the root directory is used.

### Syntax

```csharp
public string SearchPath { get; set; }
```

```vbnet
Public Property SearchPath As String
```

### Examples

The following example uses `MailMerge.SearchPath` to configure search path as part of the mail merge workflow. The configured value is checked before the workflow continues.

```csharp
mailMerge.SearchPath = "document.docx";
if (!string.IsNullOrWhiteSpace(mailMerge.SearchPath))
{
    Console.WriteLine($"Search Path: {mailMerge.SearchPath}");
}
```

```vbnet
mailMerge.SearchPath = "document.docx"
If Not String.IsNullOrWhiteSpace(mailMerge.SearchPath) Then
    Console.WriteLine($"Search Path: {mailMerge.SearchPath}")
End If
```

---

## Nearby

- **Previous:** [MailMerge.SaveDocumentToMemory Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/savedocumenttomemory-method/llms-full.txt)
- **Next:** [MailMerge.TemplateFile Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver/mailmerge/templatefile-property/llms-full.txt)
