# Javascript: TXTextControl.getTextParts Method

> Obsolete. This method will be removed in one of the next versions. Requests a collection of either all text parts the current document contains or only the text part containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

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

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

---

### Description

`Obsolete. This method will be removed in one of the next versions.` Requests a collection of either all text parts the current document contains or only the text part containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

### Syntax

```javascript
<void> TXTextControl.getTextParts(<RequestTextPartsCallback> callback, [<boolean> atInputPosition])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Is called with an array of [text parts](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textpart/llms-full.txt) as a parameter containing the requested text parts as soon as the information has been retrieved from the server. |
| atInputPosition | Optional. A boolean value indicating that only the text part containing the input position should be retrieved. |

### Examples

The following example demonstrates `TXTextControl.getTextParts` in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Requests a collection of either all text parts the current document contains or only the text part containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

```javascript
TXTextControl.getTextParts(
    function(result) {
        if (!result) {
            console.warn("No text part was returned.");
            return;
        }
        
        console.log("get text parts result:", result);
    },
    true
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getTextFrameMarkerLines Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/gettextframemarkerlines-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getUndoActionName Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getundoactionname-method/llms-full.txt)
