Enum MimeType
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
MIME タイプ文字列を明示的に入力せずに MIME タイプの宣言にアクセスできる列挙型。MIME タイプが文字列としてレンダリングされることを想定しているメソッド(
'image/png'
など)は、メソッドが基盤となる MIME タイプをサポートしている限り、次のいずれかの値も受け入れます。
// Use MimeType enum to log the name of every Google Doc in the user's Drive.
const docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS);
while (docs.hasNext()) {
const doc = docs.next();
Logger.log(doc.getName());
}
// Use plain string to log the size of every PNG in the user's Drive.
const pngs = DriveApp.getFilesByType('image/png');
while (pngs.hasNext()) {
const png = pngs.next();
Logger.log(png.getSize());
}
プロパティ
プロパティ | タイプ | 説明 |
GOOGLE_APPS_SCRIPT | Enum | Google Apps Script プロジェクトの MIME タイプの表現。 |
GOOGLE_DRAWINGS | Enum | Google ドローファイルの MIME タイプの表現。 |
GOOGLE_DOCS | Enum | Google ドキュメント ファイルの MIME タイプの表現。 |
GOOGLE_FORMS | Enum | Google フォーム ファイルの MIME タイプの表現。 |
GOOGLE_SHEETS | Enum | Google スプレッドシート ファイルの MIME タイプの表現。 |
GOOGLE_SITES | Enum | Google サイト ファイルの MIME タイプの表現。 |
GOOGLE_SLIDES | Enum | Google スライド ファイルの MIME タイプの表現。 |
FOLDER | Enum | Google ドライブ フォルダの MIME タイプの表現。 |
SHORTCUT | Enum | Google ドライブのショートカットの MIME タイプの表現。 |
BMP | Enum | BMP 画像ファイルの MIME タイプの表現(通常は .bmp)。 |
GIF | Enum | GIF 画像ファイルの MIME タイプ(通常は .gif)の表現。 |
JPEG | Enum | JPEG 画像ファイルの MIME タイプの表現(通常は .jpg)。 |
PNG | Enum | PNG 画像ファイルの MIME タイプの表現(通常は .png)。 |
SVG | Enum | SVG 画像ファイルの MIME タイプの表現(通常は .svg)。 |
PDF | Enum | PDF ファイルの MIME タイプ(通常は .pdf)の表現。 |
CSS | Enum | CSS テキスト ファイル(通常は .css)の MIME タイプの表現。 |
CSV | Enum | CSV テキスト ファイルの MIME タイプ(通常は .csv)の表現。 |
HTML | Enum | HTML テキスト ファイル(通常は .html)の MIME タイプの表現。 |
JAVASCRIPT | Enum | JavaScript テキスト ファイル(通常は .js)の MIME タイプの表現。 |
PLAIN_TEXT | Enum | プレーンテキスト ファイル(通常は .txt)の MIME タイプの表現。 |
RTF | Enum | リッチテキスト ファイル(通常は .rtf)の MIME タイプの表現。 |
OPENDOCUMENT_GRAPHICS | Enum | OpenDocument グラフィック ファイル(通常は .odg)の MIME タイプの表現。 |
OPENDOCUMENT_PRESENTATION | Enum | OpenDocument プレゼンテーション ファイルの MIME タイプの表現(通常は .odp)。 |
OPENDOCUMENT_SPREADSHEET | Enum | OpenDocument スプレッドシート ファイルの MIME タイプ(通常は .ods)の表現。 |
OPENDOCUMENT_TEXT | Enum | OpenDocument ワード プロセッシング ファイルの MIME タイプの表現(通常は .odt)。 |
MICROSOFT_EXCEL | Enum | Microsoft Excel スプレッドシート ファイルの MIME タイプ(通常は .xlsx)の表現。 |
MICROSOFT_EXCEL_LEGACY | Enum | Microsoft Excel の従来形式のファイル(通常は .xls)の MIME タイプの表現。 |
MICROSOFT_POWERPOINT | Enum | Microsoft PowerPoint プレゼンテーション ファイル(通常は .pptx)の MIME タイプの表現。 |
MICROSOFT_POWERPOINT_LEGACY | Enum | Microsoft PowerPoint の従来形式のファイル(通常は .ppt)の MIME タイプの表現。 |
MICROSOFT_WORD | Enum | Microsoft Word ドキュメント ファイル(通常は .docx)の MIME タイプの表現。 |
MICROSOFT_WORD_LEGACY | Enum | Microsoft Word の従来形式のファイル(通常は .doc)の MIME タイプの表現。 |
ZIP | Enum | ZIP アーカイブ ファイル(通常は .zip)の MIME タイプの表現。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eMimeType\u003c/code\u003e is an enumeration providing access to MIME-type declarations without manually typing strings, offering a more convenient way to specify file types in Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eMethods accepting MIME types as strings (e.g., \u003ccode\u003e'image/png'\u003c/code\u003e) also accept \u003ccode\u003eMimeType\u003c/code\u003e enum values if the underlying MIME type is supported.\u003c/p\u003e\n"],["\u003cp\u003eThis enumeration covers a wide range of file types, including Google Workspace files, common image and document formats, and Microsoft Office file types.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided property table for a comprehensive list of supported MIME types and their corresponding \u003ccode\u003eMimeType\u003c/code\u003e enum values.\u003c/p\u003e\n"]]],[],null,["# Enum MimeType\n\nMimeType\n\nAn enumeration that provides access to MIME-type declarations without typing the strings\nexplicitly. Methods that expect a MIME type rendered as a string (for example, `\n'image/png'`) also accept any of the values below, so long as the method supports the\nunderlying MIME type.\n\n```javascript\n// Use MimeType enum to log the name of every Google Doc in the user's Drive.\nconst docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS);\nwhile (docs.hasNext()) {\n const doc = docs.next();\n Logger.log(doc.getName());\n}\n\n// Use plain string to log the size of every PNG in the user's Drive.\nconst pngs = DriveApp.getFilesByType('image/png');\nwhile (pngs.hasNext()) {\n const png = pngs.next();\n Logger.log(png.getSize());\n}\n``` \n\n### Properties\n\n| Property | Type | Description |\n|-------------------------------|--------|---------------------------------------------------------------------------------------------|\n| `GOOGLE_APPS_SCRIPT` | `Enum` | Representation of MIME type for a Google Apps Script project. |\n| `GOOGLE_DRAWINGS` | `Enum` | Representation of MIME type for a Google Drawings file. |\n| `GOOGLE_DOCS` | `Enum` | Representation of MIME type for a Google Docs file. |\n| `GOOGLE_FORMS` | `Enum` | Representation of MIME type for a Google Forms file. |\n| `GOOGLE_SHEETS` | `Enum` | Representation of MIME type for a Google Sheets file. |\n| `GOOGLE_SITES` | `Enum` | Representation of MIME type for a Google Sites file. |\n| `GOOGLE_SLIDES` | `Enum` | Representation of MIME type for a Google Slides file. |\n| `FOLDER` | `Enum` | Representation of MIME type for a Google Drive folder. |\n| `SHORTCUT` | `Enum` | Representation of MIME type for a Google Drive shortcut. |\n| `BMP` | `Enum` | Representation of MIME type for a BMP image file (typically .bmp). |\n| `GIF` | `Enum` | Representation of MIME type for a GIF image file (typically .gif). |\n| `JPEG` | `Enum` | Representation of MIME type for a JPEG image file (typically .jpg). |\n| `PNG` | `Enum` | Representation of MIME type for a PNG image file (typically .png). |\n| `SVG` | `Enum` | Representation of MIME type for an SVG image file (typically .svg). |\n| `PDF` | `Enum` | Representation of MIME type for a PDF file (typically .pdf). |\n| `CSS` | `Enum` | Representation of MIME type for a CSS text file (typically .css). |\n| `CSV` | `Enum` | Representation of MIME type for a CSV text file (typically .csv). |\n| `HTML` | `Enum` | Representation of MIME type for an HTML text file (typically .html). |\n| `JAVASCRIPT` | `Enum` | Representation of MIME type for a JavaScript text file (typically .js). |\n| `PLAIN_TEXT` | `Enum` | Representation of MIME type for a plain text file (typically .txt). |\n| `RTF` | `Enum` | Representation of MIME type for a rich text file (typically .rtf). |\n| `OPENDOCUMENT_GRAPHICS` | `Enum` | Representation of MIME type for an OpenDocument graphics file (typically .odg). |\n| `OPENDOCUMENT_PRESENTATION` | `Enum` | Representation of MIME type for an OpenDocument presentation file (typically .odp). |\n| `OPENDOCUMENT_SPREADSHEET` | `Enum` | Representation of MIME type for an OpenDocument spreadsheet file (typically .ods). |\n| `OPENDOCUMENT_TEXT` | `Enum` | Representation of MIME type for an OpenDocument word-processing file (typically .odt). |\n| `MICROSOFT_EXCEL` | `Enum` | Representation of MIME type for a Microsoft Excel spreadsheet file (typically .xlsx). |\n| `MICROSOFT_EXCEL_LEGACY` | `Enum` | Representation of MIME type for a Microsoft Excel legacy file (typically .xls). |\n| `MICROSOFT_POWERPOINT` | `Enum` | Representation of MIME type for a Microsoft PowerPoint presentation file (typically .pptx). |\n| `MICROSOFT_POWERPOINT_LEGACY` | `Enum` | Representation of MIME type for a Microsoft PowerPoint legacy file (typically .ppt). |\n| `MICROSOFT_WORD` | `Enum` | Representation of MIME type for a Microsoft Word document file (typically .docx). |\n| `MICROSOFT_WORD_LEGACY` | `Enum` | Representation of MIME type for a Microsoft Word legacy file (typically .doc). |\n| `ZIP` | `Enum` | Representation of MIME type for a ZIP archive file (typically .zip). |"]]