title: Create a file inside a folder using MimeType inside Google Drive using AppScript
body: <p><a href="https://developers.google.com/apps-script/reference/base/mime-type" rel="nofollow noreferrer">https://developers.google.com/apps-script/reference/base/mime-type</a></p>
  
  <pre><code>function msWordExt() {
      var ss = SpreadsheetApp.openById('1MUwH0Cm1cwHcTWSCGPp2SePbzs_4QQmtjwOEWOrOkMw');
      var sheetName = ss.getSheetByName("Sheet2");
       var get = sheetName.getRange(2,3).getValue();
      var folder = DriveApp.getFolderById("1rsicZccurujGp5Ye5HUecBIAPf3_h5Pc");
      folder.createFile("MS Word",get,MimeType.MICROSOFT_WORD);
  }
  </code></pre>
  
  <p><strong>Goal 1</strong>: When I try to make the same code to create a Google Slides or any other google or Opendocument extension it does not work.</p>
  
  <pre><code>function msSlidesExt() {
      var ss = SpreadsheetApp.openById('1MUwH0Cm1cwHcTWSCGPp2SePbzs_4QQmtjwOEWOrOkMw');
      var sheetName = ss.getSheetByName("Sheet2");
       var get = sheetName.getRange(2,3).getValue();
      var folder = DriveApp.getFolderById("1rsicZccurujGp5Ye5HUecBIAPf3_h5Pc");
      folder.createFile("PLAIN TEXT",get,MimeType.GOOGLE_SLIDES);
  }
  </code></pre>
  
  <p>This above code will not create a Google Slides file inside my specified Drive.</p>
  
  <p><strong>Goal 2</strong> : How do I create a function where instead of hard coding this  <code>DriveApp.getFolderById("1rsicZccurujGp5Ye5HUecBIAPf3_h5Pc");</code>
  Is it possible to make this dynamic? </p>