Set paragraph style in Google Doc
set_paragraph_styleChange any paragraph in a document range to a heading or back to normal text. Restyles whole paragraphs so you can turn a line into a heading without altering its text.
Instructions
Set the named paragraph style — NORMAL_TEXT, TITLE, SUBTITLE or HEADING_1 to HEADING_6 — of every paragraph that overlaps the index range [startIndex, endIndex). Whole paragraphs are restyled even if the range covers only part of one, so a range inside a single line changes just that line’s paragraph. Use it to turn a line into a heading or back into normal text. Get paragraph startIndex/endIndex from get_document’s structure outline or find_text. Does not change text or indexes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | Yes | Named paragraph style, e.g. HEADING_1 for a top-level heading. | |
| endIndex | Yes | End of the range (exclusive); must be greater than startIndex. | |
| documentId | Yes | The Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted. | |
| startIndex | Yes | Start of the range (inclusive). Get exact indexes from get_document or find_text. |