解决方法:如何编辑本地Google文档? [英] Workarounds : How to edit native google documents programatcally?

查看:244
本文介绍了解决方法:如何编辑本地Google文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里发现了一些非常抑郁的QA,其中提到Google文档无法在Google Drive API中以编程方式进行修改 - 只有上传/下载选项。

我检查过那些类似的主题:

1)如何以编程方式操作本地Google文档



2)如何以编程方式在Google Docs中创建文档?

因为我想我们不能直接下载和上传本地谷歌文档格式。有没有其他方法可以解决这个问题?

有没有人试图在选定的文档上以编程方式触发Google应用程序脚本,这可能吗?是否有可能以输入参数的方式编程启动Google应用程序脚本?



我只需要替换本地Google文档中的几段文字,但我不能使用下载 - >修改 - >上传(例如与格式word / html / pdf)流,因为我会打破格式的图片,边界等...(客户要求:全谷歌整合没有专有格式)



您是否有任何创新的想法或建议可供您探索?

我们试图将Google Drive用作某种非常简单的模板系统(〜数千用户,数百个Google文档),但它似乎是真的是错误的想法,因为在路上有很多限制。 您不能使用云端硬盘API以编程方式管理Google文档的内容,但您可以使用Apps Script中的文档服务执行文本替换和其他编辑: https://developers.google.com/apps-script/service_document

i found few quite depressive QA here which mentioned that google documents cannot be modified programatically in Google Drive API - there`s just upload/download option.

I checked those similar topics :

1) How to programmatically manipulate native google doc files

2) How do you create a document in Google Docs programmatically?

As i suppose we cannot download and upload directly native google doc formats. Is there any other way how to solve this requirement ?

Has anyone tried to trigger google app script programatically on selected document, is that possible ? Is possible to start google app script programatically with some parameters on the input ?

I just need to replace few pieces of text in native google doc`s but i cannot use download->modify->upload (e.g. with formats word/html/pdf) flow as i would broken formatting of pictures,borders etc... (customer requirement : full google integration no proprietary formats)

Do you have any innovative ideas or tips which would be good to explore ?

We are trying to use Google Drive as some kind of very simple templating system (~ thousands of users, hundreds of google documents) but it seems to be a really wrong idea as there is a lot of limitations on the way.

解决方案

You can't use the Drive API to programmatically manage the content of a Google Document but you can use the Document Service in Apps Script to perform text replacing and other editing:

https://developers.google.com/apps-script/service_document

这篇关于解决方法:如何编辑本地Google文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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