如何在谷歌应用程序脚本中获取 HTML 形式的谷歌文档?
例如。我可以像这样获取文档正文。
DocumentApp.getActiveDocument().getBody();
但是当我登录时什么也没有。
function doc_to_html()
{
var id = document_Id;
var url = "https://docs.google.com/feeds/download/documents/export/Export?id="+id+"&exportFormat=html";
var param =
{
method : "get",
headers : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
muteHttpExceptions:true,
};
var html = UrlFetchApp.fetch(url,param).getContentText();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)