Enum ParagraphHeading
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
AbsatzÜberschrift
Eine Aufzählung der Standardabsatzüberschriften.
Wenn Sie ein Enum aufrufen möchten, rufen Sie die übergeordnete Klasse, den Namen und die Eigenschaft auf. Beispiel:
DocumentApp.ParagraphHeading.NORMAL
.
Verwenden Sie die Aufzählung ParagraphHeading
, um den Stil der Überschrift für ParagraphElement
zu konfigurieren.
const body =
DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();
// Append a paragraph, with heading 1.
const par1 = body.appendParagraph('Title');
par1.setHeading(DocumentApp.ParagraphHeading.HEADING1);
// Append a paragraph, with heading 2.
const par2 = body.appendParagraph('SubTitle');
par2.setHeading(DocumentApp.ParagraphHeading.HEADING2);
// Append a paragraph, with normal heading.
const par3 = body.appendParagraph('Text');
par3.setHeading(DocumentApp.ParagraphHeading.NORMAL);
Attribute
Attribut | Typ | Beschreibung |
NORMAL | Enum | Die Überschriftenoption für normalen Text. |
HEADING1 | Enum | Die höchste Überschriftenoption. |
HEADING2 | Enum | Die zweite Überschriftenoption. |
HEADING3 | Enum | Die dritte Überschriftenoption |
HEADING4 | Enum | Die vierte Option für Überschriften. |
HEADING5 | Enum | Die fünfte Option für Überschriften. |
HEADING6 | Enum | Die niedrigste Überschriftenoption. |
TITLE | Enum | Die Option für die Titelüberschrift. |
SUBTITLE | Enum | Die Option für Untertitelüberschriften. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eParagraphHeading\u003c/code\u003e enumeration is used to set heading styles for paragraphs in Google Docs.\u003c/p\u003e\n"],["\u003cp\u003eYou can use properties like \u003ccode\u003eNORMAL\u003c/code\u003e, \u003ccode\u003eHEADING1\u003c/code\u003e to \u003ccode\u003eHEADING6\u003c/code\u003e, \u003ccode\u003eTITLE\u003c/code\u003e, and \u003ccode\u003eSUBTITLE\u003c/code\u003e to define different heading levels.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code snippet demonstrates how to append paragraphs with different heading styles using \u003ccode\u003esetHeading()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe table lists all available \u003ccode\u003eParagraphHeading\u003c/code\u003e properties, their types, and descriptions.\u003c/p\u003e\n"]]],[],null,["# Enum ParagraphHeading\n\nParagraphHeading\n\nAn enumeration of the standard paragraph headings.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nDocumentApp.ParagraphHeading.NORMAL`.\n\nUse the `Paragraph``Heading` enumeration to configure the heading style for `Paragraph``Element`.\n\n```javascript\nconst body =\n DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();\n\n// Append a paragraph, with heading 1.\nconst par1 = body.appendParagraph('Title');\npar1.setHeading(DocumentApp.ParagraphHeading.HEADING1);\n\n// Append a paragraph, with heading 2.\nconst par2 = body.appendParagraph('SubTitle');\npar2.setHeading(DocumentApp.ParagraphHeading.HEADING2);\n\n// Append a paragraph, with normal heading.\nconst par3 = body.appendParagraph('Text');\npar3.setHeading(DocumentApp.ParagraphHeading.NORMAL);\n``` \n\n### Properties\n\n| Property | Type | Description |\n|------------|--------|-------------------------------------|\n| `NORMAL` | `Enum` | The heading option for normal text. |\n| `HEADING1` | `Enum` | The highest heading option. |\n| `HEADING2` | `Enum` | The second heading option. |\n| `HEADING3` | `Enum` | The third heading option |\n| `HEADING4` | `Enum` | The fourth heading option. |\n| `HEADING5` | `Enum` | The fifth heading option. |\n| `HEADING6` | `Enum` | The lowest heading option. |\n| `TITLE` | `Enum` | The title heading option. |\n| `SUBTITLE` | `Enum` | The subtitle heading option. |"]]