如何以编程方式操作本地谷歌文档文件 [英] How to programmatically manipulate native google doc files

查看:140
本文介绍了如何以编程方式操作本地谷歌文档文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程方式编辑本机Google文档,比如说让某些文字变为粗体或超链接?我知道我可以将它导出为DOC或ODT等格式,然后执行更改并放回原处。但手动尝试这种方式,看到我失去了确切的外观。找不到本地Google文档的任何API或对象模型,但似乎有一些电子表格。

解析方案

无法使用REST API以编程方式编辑Google文档(Google的文字处理器文档)。只有Google Spreadsheet现在提供此类API



您可以试用Google Apps Script: https://developers.google.com/apps-script/ 它是一个托管脚本环境,它提供了一个 Google文档服务,允许您编辑和管理现有的Google文档。



最后,您始终可以使用RTF等开放格式上传文档,并使用Google Drive API将其转换为本地Google文档。


Is it possible to programmatically edit a native Google document, say to make certain words bold or hyperlinks? I know I can export that to some format like DOC or ODT, do the changes and put back. But tried this way manually and saw that I lost the exact look. Could not find any API or object model for native Google docs, although seems there is something for the spreadsheets.

解决方案

Unfortunately it is not possible to programmatically edit Google Documents (Google's Word Processor document) using a REST API. Only Google Spreadsheet offers such an API at the moment.

You could try Google Apps Script: https://developers.google.com/apps-script/ it is a hosted scripting environment and it offers a Google Documents Service that allows you to edit and manage existing Google Documents.

Lastly you could always upload a document using an open format such as RTF and have it converted to a native Google Documents using the Google Drive API.

这篇关于如何以编程方式操作本地谷歌文档文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆