開啟文件,將預設的格式,逐一套落文件中的每一項(CHILD)並加在文件中的尾部
function myFunction2(){
var myDoc = DocumentApp.openById('1ecB4hbtm5-MC59cTap2EZ46eEPRsN8WHpajjBWd4UIU');
var body = myDoc.getBody();
var holder = "NEW OUTPUT";
var style = {};
style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
style[DocumentApp.Attribute.BOLD] = true;
style[DocumentApp.Attribute.FONT_SIZE] = 24;
style[DocumentApp.Attribute.BACKGROUND_COLOR] = '#FF0000';
style[DocumentApp.Attribute.FOREGROUND_COLOR]= '#FFFFFF';
for(x=0;x<body.getNumChildren();x++){
holder += x + '. ' + body.getChild(x).getText() + '\n' ;
}
沒有留言:
張貼留言