Enum ParagraphHeading Stay organized with collections Save and categorize content based on your preferences.
Page Summary
ParagraphHeading is an enumeration used to configure heading styles for ParagraphElement.
Enums are called using their parent class, name, and property, such as DocumentApp.ParagraphHeading.NORMAL.
The provided code example demonstrates how to set different heading styles for paragraphs using appendParagraph and setHeading.
Available ParagraphHeading properties include NORMAL, HEADING1 through HEADING6, TITLE, and SUBTITLE.
An enumeration of the standard paragraph headings.
To call an enum, you call its parent class, name, and property. For example,DocumentApp.ParagraphHeading.NORMAL.
Use theParagraph enumeration to configure the heading style forParagraph.
constbody=DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();// Append a paragraph, with heading 1.constpar1=body.appendParagraph('Title');par1.setHeading(DocumentApp.ParagraphHeading.HEADING1);// Append a paragraph, with heading 2.constpar2=body.appendParagraph('SubTitle');par2.setHeading(DocumentApp.ParagraphHeading.HEADING2);// Append a paragraph, with normal heading.constpar3=body.appendParagraph('Text');par3.setHeading(DocumentApp.ParagraphHeading.NORMAL);
Properties
| Property | Type | Description |
|---|---|---|
NORMAL | Enum | The heading option for normal text. |
HEADING1 | Enum | The highest heading option. |
HEADING2 | Enum | The second heading option. |
HEADING3 | Enum | The third heading option |
HEADING4 | Enum | The fourth heading option. |
HEADING5 | Enum | The fifth heading option. |
HEADING6 | Enum | The lowest heading option. |
TITLE | Enum | The title heading option. |
SUBTITLE | Enum | The subtitle heading option. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.