Enum ElementType

ElementType

すべての要素タイプの列挙型。

列挙型を呼び出すには、親クラス、名前、プロパティを呼び出します。たとえば、 DocumentApp.ElementType.BODY_SECTION です。

ElementType 列挙型を使用すると、特定の要素の型を確認できます。次に例を示します。

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

プロパティ

プロパティ種類説明
BODY_SECTIONEnumBody 要素に対応する型。
COMMENT_SECTIONEnumCommentSection 要素に対応する型。
DATEEnumDate 要素に対応する型。
DOCUMENTEnumドキュメントのルートに対応する型。
EQUATIONEnumEquation 要素に対応する型。
EQUATION_FUNCTIONEnumEquationFunction 要素に対応する型。
EQUATION_FUNCTION_ARGUMENT_SEPARATOREnumEquationFunctionArgumentSeparator 要素に対応する型。
EQUATION_SYMBOLEnumEquationSymbol 要素に対応する型。
RICH_LINKEnumRichLink 要素に対応する型。
FOOTER_SECTIONEnumFooterSection 要素に対応する型。
FOOTNOTEEnumFootnote 要素に対応する型。
FOOTNOTE_SECTIONEnumFootnoteSection 要素に対応する型。
HEADER_SECTIONEnumHeaderSection 要素に対応する型。
HORIZONTAL_RULEEnumHorizontalRule 要素に対応する型。
INLINE_DRAWINGEnumInlineDrawing 要素に対応する型。
INLINE_IMAGEEnumInlineImage 要素に対応する型。
LIST_ITEMEnumListItem 要素に対応する型。
PAGE_BREAKEnumPageBreak 要素に対応する型。
PARAGRAPHEnumParagraph 要素に対応する型。
PERSONEnumPerson 要素に対応する型。
TABLEEnumTable 要素に対応する型。
TABLE_CELLEnumTableCell 要素に対応する型。
TABLE_OF_CONTENTSEnumTableOfContents 要素に対応する型。
TABLE_ROWEnumTableRow 要素に対応する型。
TEXTEnumText 要素に対応する型。
UNSUPPORTEDEnumUnsupportedElement に対応する型。サポートされていない要素は、スクリプトをサポートしていないドキュメント部分を表します。