Enum ElementType

ElementType

Es una enumeración de todos los tipos de elementos.

Para llamar a una enumeración, debes llamar a su clase principal, nombre y propiedad. Por ejemplo,  DocumentApp.ElementType.BODY_SECTION.

Usa la enumeración ElementType para verificar el tipo de un elemento determinado, por ejemplo:

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);
}

Propiedades

PropiedadTipoDescripción
BODY_SECTIONEnumEs el tipo correspondiente al elemento Body.
COMMENT_SECTIONEnumEs el tipo correspondiente al elemento CommentSection.
DATEEnumEs el tipo correspondiente al elemento Date.
EQUATIONEnumEs el tipo correspondiente al elemento Equation.
EQUATION_FUNCTIONEnumEs el tipo correspondiente al elemento EquationFunction.
EQUATION_FUNCTION_ARGUMENT_SEPARATOREnumEs el tipo correspondiente al elemento EquationFunctionArgumentSeparator.
EQUATION_SYMBOLEnumEs el tipo correspondiente al elemento EquationSymbol.
RICH_LINKEnumEs el tipo correspondiente al elemento RichLink.
FOOTER_SECTIONEnumEs el tipo correspondiente al elemento FooterSection.
FOOTNOTEEnumEs el tipo correspondiente al elemento Footnote.
FOOTNOTE_SECTIONEnumEs el tipo correspondiente al elemento FootnoteSection.
HEADER_SECTIONEnumEs el tipo correspondiente al elemento HeaderSection.
HORIZONTAL_RULEEnumEs el tipo correspondiente al elemento HorizontalRule.
INLINE_DRAWINGEnumEs el tipo correspondiente al elemento InlineDrawing.
INLINE_IMAGEEnumEs el tipo correspondiente al elemento InlineImage.
LIST_ITEMEnumEs el tipo correspondiente al elemento ListItem.
PAGE_BREAKEnumEs el tipo correspondiente al elemento PageBreak.
PARAGRAPHEnumEs el tipo correspondiente al elemento Paragraph.
PERSONEnumEs el tipo correspondiente al elemento Person.
TABLEEnumEs el tipo correspondiente al elemento Table.
TABLE_CELLEnumEs el tipo correspondiente al elemento TableCell.
TABLE_OF_CONTENTSEnumEs el tipo correspondiente al elemento TableOfContents.
TABLE_ROWEnumEs el tipo correspondiente al elemento TableRow.
TEXTEnumEs el tipo correspondiente al elemento Text.
UNSUPPORTEDEnumEs el tipo correspondiente a UnsupportedElement. Los elementos no admitidos representan partes del documento que no admiten secuencias de comandos.