AI-generated Key Takeaways
- 
          ElementType is an enumeration listing all possible element types in a document. 
- 
          You access ElementType enum values using the parent class, name, and property like DocumentApp.ElementType.BODY_SECTION.
- 
          ElementType can be used to check the type of a specific element in a document, as shown in the provided code example. 
- 
          The table lists various ElementType properties and their corresponding document elements. 
An enumeration of all the element types.
To call an enum, you call its parent class, name, and property. For example, 
DocumentApp.ElementType.BODY_SECTION.
Use the Element enumeration to check the type of a given element, for instance:
const documentTab = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab(); const firstChild = documentTab.getBody().getChild(0); if (firstChild.getType() === DocumentApp.ElementType.PARAGRAPH) { // It's a paragraph, apply a paragraph heading. firstChild.asParagraph().setHeading(DocumentApp.ParagraphHeading.HEADING1); }
Properties
| Property | Type | Description | 
|---|---|---|
| BODY_SECTION | Enum | The type corresponding to the Bodyelement. | 
| COMMENT_SECTION | Enum | The type corresponding to the element. | 
| DATE | Enum | The type corresponding to the Dateelement. | 
| EQUATION | Enum | The type corresponding to the Equationelement. | 
| EQUATION_FUNCTION | Enum | The type corresponding to the Equationelement. | 
| EQUATION_FUNCTION_ARGUMENT_SEPARATOR | Enum | The type corresponding to the Equationelement. | 
| EQUATION_SYMBOL | Enum | The type corresponding to the Equationelement. | 
| RICH_LINK | Enum | The type corresponding to the Richelement. | 
| FOOTER_SECTION | Enum | The type corresponding to the Footerelement. | 
| FOOTNOTE | Enum | The type corresponding to the Footnoteelement. | 
| FOOTNOTE_SECTION | Enum | The type corresponding to the Footnoteelement. | 
| HEADER_SECTION | Enum | The type corresponding to the Headerelement. | 
| HORIZONTAL_RULE | Enum | The type corresponding to the Horizontalelement. | 
| INLINE_DRAWING | Enum | The type corresponding to the Inlineelement. | 
| INLINE_IMAGE | Enum | The type corresponding to the Inlineelement. | 
| LIST_ITEM | Enum | The type corresponding to the Listelement. | 
| PAGE_BREAK | Enum | The type corresponding to the Pageelement. | 
| PARAGRAPH | Enum | The type corresponding to the Paragraphelement. | 
| PERSON | Enum | The type corresponding to the Personelement. | 
| TABLE | Enum | The type corresponding to the Tableelement. | 
| TABLE_CELL | Enum | The type corresponding to the Tableelement. | 
| TABLE_OF_CONTENTS | Enum | The type corresponding to the Tableelement. | 
| TABLE_ROW | Enum | The type corresponding to the Tableelement. | 
| TEXT | Enum | The type corresponding to the Textelement. | 
| UNSUPPORTED | Enum | The type corresponding to Unsupported. Unsupported elements
represent document portions that do not support scripting. |