Enum ElementType Stay organized with collections Save and categorize content based on your preferences.
Page Summary
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 theElement enumeration to check the type of a given element, for instance:
constdocumentTab=DocumentApp.getActiveDocument().getActiveTab().asDocumentTab();constfirstChild=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 theBody element. |
COMMENT_SECTION | Enum | The type corresponding to the element. |
DATE | Enum | The type corresponding to theDateelement. |
EQUATION | Enum | The type corresponding to theEquation element. |
EQUATION_FUNCTION | Enum | The type corresponding to theEquation element. |
EQUATION_FUNCTION_ARGUMENT_SEPARATOR | Enum | The type corresponding to theEquationelement. |
EQUATION_SYMBOL | Enum | The type corresponding to theEquation element. |
RICH_LINK | Enum | The type corresponding to theRich element. |
FOOTER_SECTION | Enum | The type corresponding to theFooter element. |
FOOTNOTE | Enum | The type corresponding to theFootnote element. |
FOOTNOTE_SECTION | Enum | The type corresponding to theFootnote element. |
HEADER_SECTION | Enum | The type corresponding to theHeader element. |
HORIZONTAL_RULE | Enum | The type corresponding to theHorizontal element. |
INLINE_DRAWING | Enum | The type corresponding to theInline element. |
INLINE_IMAGE | Enum | The type corresponding to theInline element. |
LIST_ITEM | Enum | The type corresponding to theList element. |
PAGE_BREAK | Enum | The type corresponding to thePage element. |
PARAGRAPH | Enum | The type corresponding to theParagraph element. |
PERSON | Enum | The type corresponding to thePerson element. |
TABLE | Enum | The type corresponding to theTable element. |
TABLE_CELL | Enum | The type corresponding to theTable element. |
TABLE_OF_CONTENTS | Enum | The type corresponding to theTable element. |
TABLE_ROW | Enum | The type corresponding to theTable element. |
TEXT | Enum | The type corresponding to theTextelement. |
UNSUPPORTED | Enum | The type corresponding toUnsupported. Unsupported elementsrepresent document portions that do not support scripting. |
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.