我是 Google Apps 脚本的新手。我想上传 doc、docx 等文档文件并想添加更多页面?如何自定义上传的文档,[如添加自定义页眉和页脚]?
这是我的代码
function doGet(e) {
var app = UiApp.createApplication().setTitle("Upload Resume");
var form = app.createFormPanel().setId('frm').setEncoding('multipart/form-data');
var formContent = app.createVerticalPanel();
form.add(formContent);
formContent.add(app.createFileUpload().setName('thefile'));
formContent.add(app.createSubmitButton('Submit'));
app.add(form);
return app;
}
function doPost(e) {
var fileBlob = e.parameter.thefile;
var a= DocsList.FileType.DOCUMENT
var doc = DocsList.createFile(fileBlob);
var app = UiApp.getActiveApplication();
var label = app.createLabel('Resume uploaded successfully'+a );
app.add(label);
return app;
}