# DataSourceManager.InsertMergeBlock Method

> Inserts a repeating merge block into a TextControl instance, a WPF.TextControl instance or a ServerTextControl instance at the current input position.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl.DocumentServer.DataSources > DataSourceManager.InsertMergeBlock Method
- **756 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/insertmergeblock-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/insertmergeblock-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/insertmergeblock-method/llms-full.txt

---

### Description

Inserts a repeating merge block into a [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt) instance, a [WPF.TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt) instance or a [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/llms-full.txt) instance at the current input position.

### Syntax

```csharp
public void InsertMergeBlock(object textControl, MergeBlockInfo mergeBlockInfo, MergeBlockSettings settings);
```

```vbnet
Public Sub InsertMergeBlock(textControl As Object, mergeBlockInfo As MergeBlockInfo, settings As MergeBlockSettings)
```

### Parameters

| Parameter | Description |
|---|---|
| textControl | A [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt) instance, a [WPF.TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt) instance or a [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/llms-full.txt) instance. |
| mergeBlockInfo | A [MergeBlockInfo](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/mergeblockinfo/llms-full.txt) object which describes the merge block to insert into the TextControl instance. |
| settings | A [MergeBlockSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/mergeblocksettings/llms-full.txt) object which describes the settings of the merge block to insert into the TextControl instance. |

### Examples

The following example uses Insert Merge Block in a focused Data Source Manager workflow. The created object is then available to the surrounding document workflow.

```csharp
dataSourceManager.InsertMergeBlock("Approved", new TXTextControl.DocumentServer.DataSources.MergeBlockInfo("CustomerName"), new TXTextControl.DocumentServer.DataSources.MergeBlockSettings());
Console.WriteLine("Data Source Manager is ready for use.");
```

```vbnet
dataSourceManager.InsertMergeBlock("Approved", New TXTextControl.DocumentServer.DataSources.MergeBlockInfo("CustomerName"), New TXTextControl.DocumentServer.DataSources.MergeBlockSettings())
Console.WriteLine("Data Source Manager is ready for use.")
```

---

## Nearby

- **Previous:** [DataSourceManager.FieldMerged Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/fieldmerged-event/llms-full.txt)
- **Next:** [DataSourceManager.IsMergeBlock Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-datasources/datasourcemanager/ismergeblock-method/llms-full.txt)
