You can use DocumentApp.create('File_Name')
to create a fileType of GOOGLE_DOCS
. DocumentApp service allows to create and manipulate Google Documents. For more details, you may check the reference.
References:
In order to place the recently create Document in a Folder, you may use DriveApp
. Here is a sample code.
function createandPlaceInFolder(){
//Create the document
var doc = DocumentApp.create('My new file');
//get it as a drive file
var file = DriveApp.getFileById(doc.getId());
//get the target folder
var targetFolder = DriveApp.getFolderById('MY_FOLDER_ID');//Change it to the folder_Id
//place the file in target folder
targetFolder.addFile(file);
}