ParagraphStyleCollection Object
Description
Contains all paragraph formatting styles in the current document.
Syntax
ParagraphStyleCollectionExamples
The following example demonstrates ParagraphStyleCollection in a practical document-editing workflow. It contains all paragraph formatting styles in the current document.
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
);Members
Methods
| Method | Description |
|---|---|
| add | Adds a new style to the current document. |
| getItem | Gets a style from the collection by the style's name. |
| remove | Removes a formatting style from the collection. (Inherited from FormattingStyleCollection.) |