# Javascript: FormattedText.frames Property

> Gets a collection of all frames in the document.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FormattedText.frames Property
- **227 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/frames-property/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/frames-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/frames-property/llms-full.txt

---

### Description

Gets a collection of all frames in the document.

### Syntax

```javascript
<FrameCollection> FormattedText.frames
```

### Examples

The following example demonstrates `FormattedText.frames` in a practical document-editing workflow. It gets a collection of all frames in the document.

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

TXTextControl.textParts.getMainText(function(formattedText) {
    formattedText.frames.getCount(function(count) {
        console.log("frames count:", count);
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: FormattedText.formFields Property](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/formfields-property/llms-full.txt)
- **Next:** [Javascript: FormattedText.getTextFieldsByType Method](https://docs.textcontrol.com/ds-server/reference/javascript/formattedtext/gettextfieldsbytype-method/llms-full.txt)
