所有元素类型的枚举。
如需调用枚举,您可以调用其父类、名称和属性。例如 
DocumentApp.ElementType.BODY_SECTION。
使用 Element 枚举检查给定元素的类型,例如:
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); }
属性
| 属性 | 类型 | 说明 | 
|---|---|---|
| BODY_SECTION | Enum | 与 Body元素对应的类型。 | 
| COMMENT_SECTION | Enum | 与 元素对应的类型。 | 
| DATE | Enum | 与 Date元素对应的类型。 | 
| EQUATION | Enum | 与 Equation元素对应的类型。 | 
| EQUATION_FUNCTION | Enum | 与 Equation元素对应的类型。 | 
| EQUATION_FUNCTION_ARGUMENT_SEPARATOR | Enum | 与 Equation元素对应的类型。 | 
| EQUATION_SYMBOL | Enum | 与 Equation元素对应的类型。 | 
| RICH_LINK | Enum | 与 Rich元素对应的类型。 | 
| FOOTER_SECTION | Enum | 与 Footer元素对应的类型。 | 
| FOOTNOTE | Enum | 与 Footnote元素对应的类型。 | 
| FOOTNOTE_SECTION | Enum | 与 Footnote元素对应的类型。 | 
| HEADER_SECTION | Enum | 与 Header元素对应的类型。 | 
| HORIZONTAL_RULE | Enum | 与 Horizontal元素对应的类型。 | 
| INLINE_DRAWING | Enum | 与 Inline元素对应的类型。 | 
| INLINE_IMAGE | Enum | 与 Inline元素对应的类型。 | 
| LIST_ITEM | Enum | 与 List元素对应的类型。 | 
| PAGE_BREAK | Enum | 与 Page元素对应的类型。 | 
| PARAGRAPH | Enum | 与 Paragraph元素对应的类型。 | 
| PERSON | Enum | 与 Person元素对应的类型。 | 
| TABLE | Enum | 与 Table元素对应的类型。 | 
| TABLE_CELL | Enum | 与 Table元素对应的类型。 | 
| TABLE_OF_CONTENTS | Enum | 与 Table元素对应的类型。 | 
| TABLE_ROW | Enum | 与 Table元素对应的类型。 | 
| TEXT | Enum | 与 Text元素对应的类型。 | 
| UNSUPPORTED | Enum | 与 Unsupported对应的类型。不受支持的元素表示不支持脚本的文档部分。 |