Enum ElementType

ElementType

Énumération de tous les types d'éléments.

Pour appeler une énumération, vous devez appeler sa classe parente, son nom et sa propriété. Par exemple, DocumentApp.ElementType.BODY_SECTION.

Utilisez l'énumération ElementType pour vérifier le type d'un élément donné, par exemple:

var firstChild = DocumentApp.getActiveDocument().getBody().getChild(0);
if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
  // It's a paragraph, apply a paragraph heading.
  firstChild.asParagraph().setHeading(DocumentApp.ParagraphHeading.HEADING1);
}

Propriétés

PropriétéTypeDescription
BODY_SECTIONEnumType correspondant à l'élément Body.
COMMENT_SECTIONEnumType correspondant à l'élément CommentSection.
DATEEnumType correspondant à l'élément Date.
DOCUMENTEnumType correspondant à la racine du document.
EQUATIONEnumType correspondant à l'élément Equation.
EQUATION_FUNCTIONEnumType correspondant à l'élément EquationFunction.
EQUATION_FUNCTION_ARGUMENT_SEPARATOREnumType correspondant à l'élément EquationFunctionArgumentSeparator.
EQUATION_SYMBOLEnumType correspondant à l'élément EquationSymbol.
RICH_LINKEnumType correspondant à l'élément RichLink.
FOOTER_SECTIONEnumType correspondant à l'élément FooterSection.
FOOTNOTEEnumType correspondant à l'élément Footnote.
FOOTNOTE_SECTIONEnumType correspondant à l'élément FootnoteSection.
HEADER_SECTIONEnumType correspondant à l'élément HeaderSection.
HORIZONTAL_RULEEnumType correspondant à l'élément HorizontalRule.
INLINE_DRAWINGEnumType correspondant à l'élément InlineDrawing.
INLINE_IMAGEEnumType correspondant à l'élément InlineImage.
LIST_ITEMEnumType correspondant à l'élément ListItem.
PAGE_BREAKEnumType correspondant à l'élément PageBreak.
PARAGRAPHEnumType correspondant à l'élément Paragraph.
PERSONEnumType correspondant à l'élément Person.
TABLEEnumType correspondant à l'élément Table.
TABLE_CELLEnumType correspondant à l'élément TableCell.
TABLE_OF_CONTENTSEnumType correspondant à l'élément TableOfContents.
TABLE_ROWEnumType correspondant à l'élément TableRow.
TEXTEnumType correspondant à l'élément Text.
UNSUPPORTEDEnumType correspondant à UnsupportedElement. Les éléments non compatibles représentent des parties de document non compatibles avec l'écriture de script.