在谷歌应用程序脚本中以 HTML 格式获取谷歌文档

Ara*_*yan 5 html google-docs google-apps-script

如何在谷歌应用程序脚本中将谷歌文档作为 HTML 获取?例如。我可以像这样获得文档正文。

DocumentApp.getActiveDocument().getBody();
Run Code Online (Sandbox Code Playgroud)

但是当我记录它时什么都没有。

Adh*_*eel 6

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();
}
Run Code Online (Sandbox Code Playgroud)