# ParagraphStyleCollection Object

> Contains all paragraph formatting styles in the current document.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > ParagraphStyleCollection Object
- **451 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/llms-full.txt

---

### Description

Contains all [paragraph formatting styles](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstyle/llms-full.txt) in the current document.

### Syntax

```javascript
ParagraphStyleCollection
```

### Examples

The following example demonstrates `ParagraphStyleCollection` in a practical document-editing workflow. It contains all paragraph formatting styles in the current document.

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

TXTextControl.paragraphStyles.getItem(
    "Heading 1",
    function(style) {
        if (!style) {
            console.warn("No paragraph style was returned.");
            return;
        }
        
        console.log("get item result:", style);
    },
    onTxError
);
```

---

## In This Section

- [Javascript: ParagraphStyleCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/add-method/llms-full.txt): Adds a new style to the current document.
- [Javascript: ParagraphStyleCollection.getItem Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/getitem-method/llms-full.txt): Gets a style from the collection by the style's name.

---

## Nearby

- **Previous:** [Javascript: ParagraphStyle.setFollowingStyle Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstyle/setfollowingstyle-method/llms-full.txt)
- **Next:** [Javascript: ParagraphStyleCollection.add Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphstylecollection/add-method/llms-full.txt)
