# Javascript: FormattedText.textPartType Property

> Gets the Text part type. Possible values are "mainText", "headerFooter" and "textFrame".

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: FormattedText.textPartType Property
- **249 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/textparttype-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/textparttype-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/textparttype-property/llms-full.txt

---

### Description

Gets the Text part type. Possible values are "mainText", "headerFooter" and "textFrame".

### Syntax

```javascript
<string> FormattedText.textPartType
```

### Examples

The following example demonstrates `FormattedText.textPartType` in a practical document-editing workflow. It gets the Text part type. Possible values are "mainText", "headerFooter" and "textFrame".

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

TXTextControl.textParts.getMainText(function(formattedText) {
    const textPartType = formattedText.textPartType;
    console.log("text part type:", textPartType);
}, onTxError);
```

### Limitations

Read Only.

---

## Nearby

- **Previous:** [Javascript: FormattedText.textFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/textfields-property/llms-full.txt)
- **Next:** [Javascript: FormattedText.trackedChanges Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/trackedchanges-property/llms-full.txt)
