# LoadFromMemory Method

> Loads a document from a byte array into TXTextControl in a given format, replacing the whole content or the current selection, and returns True on success.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > LoadFromMemory Method
- **352 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/loadfrommemory-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/loadfrommemory-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/loadfrommemory-method/llms-full.txt

---

Loads text in a certain format from a buffer and inserts it into the Text Control.

### Syntax

```vbscript
TXTextControl.LoadFromMemory DataArray[, Format[, CurSelection]]
```

### Parameters

| Parameter | Description |
|---|---|
| DataArray | Specifies the byte array to load from. |
| Format | Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). See the Format parameter of the [Load](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/load-method/llms-full.txt) method for possible format identifiers. |
| CurSelection | Optional. When set to true the loaded data replaces the current selection or is inserted at the current input position. The new input position is behind the inserted data. When omitted or set to false the loaded data replaces the complete control contents independent of the current selection. The new input position is at the beginning of the data. |

### Return Value

The method returns True if the data could be loaded, otherwise it returns False.

### Data Types

| Name | Data type |
|---|---|
| DataArray | One-dimensional Byte Array |
| Format | Integer |
| CurSelection | Boolean |
| Return value | Boolean |

### See Also

- [PDF Export](https://docs.textcontrol.com/tx-text-control-activex/pdf/llms-full.txt)
- [Load Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/load-method/llms-full.txt)
- [SaveToMemory Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/savetomemory-method/llms-full.txt)
- [Programming Category: Loading, Saving and Database Support](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/load-save/llms-full.txt)

---

## Nearby

- **Previous:** [LoadDialog Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/loaddialog-method/llms-full.txt)
- **Next:** [LoadSaveAttribute Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/loadsaveattribute-property/llms-full.txt)
