# Javascript: TXTextControl.textParts Property

> Gets a collection of all main text parts the current document contains. The main text parts are the main text, text frames and headers and footers.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.textParts Property
- **241 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/textparts-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/textparts-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/textparts-property/llms-full.txt

---

### Description

Gets a collection of all main text parts the current document contains. The main text parts are the main text, text frames and headers and footers.

### Syntax

```javascript
<TextPartCollection> TXTextControl.textParts
```

### Examples

The following example demonstrates `TXTextControl.textParts` in a practical document-editing workflow. It gets a collection of all main text parts the current document contains. The main text parts are the main text, text frames and headers and footers.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

tXTextControl.textParts.getCount(function(count) {
    console.log("text parts count:", count);
}, onTxError);
```

### Limitations

Read Only.

---

## Nearby

- **Previous:** [Javascript: TXTextControl.textFrames Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/textframes-property/llms-full.txt)
- **Next:** [Javascript: TXTextControl.TextType Enumeration](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/texttype-enumeration/llms-full.txt)
