# Javascript: TXTextControl.loadSelection Method

> Obsolete. This method will be removed in one of the next versions. Loads text in a certain format into the current selection.

> **Note:** This is deprecated and should not be used in new work.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: TXTextControl.loadSelection Method
- **301 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/loadselection-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/loadselection-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/loadselection-method/llms-full.txt

---

### Description

`Obsolete. This method will be removed in one of the next versions.` Loads text in a certain format into the current selection.

### Syntax

```javascript
<void> TXTextControl.loadSelection(<StreamType> streamType, <string> base64Data)
```

### Parameters

| Parameter | Description |
|---|---|
| streamType | Specifies one of the numerical [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/streamtype-enumeration/llms-full.txt) values. |
| base64Data | Base64 encoded document data. |

### Examples

For an example on how to use this function have a look at the description of the [loadDocument](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/loaddocument-method/llms-full.txt) function.

The following example demonstrates `TXTextControl.loadSelection` in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Loads text in a certain format into the current selection.

```javascript
TXTextControl.loadSelection(
    TXTextControl.StreamType.HTMLFormat,
    "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg=="
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.loadJsonData Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/loadjsondata-method/llms-full.txt)
- **Next:** [TXTextControl.LoadSettings Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol-loadsettings/llms-full.txt)
