Javascript 突出显示google文档中的word
有没有办法突出显示使用google doc查看的docx文件中的特定单词 例如: 我有以下文档,我正在使用谷歌文档查看它,我需要在文档中用另一种颜色突出显示“Step”字 除了打开文档、编辑文档、保存文档然后将其返回到Google doc viewer之外,还有其他可用的方法吗?您可以使用这些方法创建、访问和修改Google doc文件 以下是文档中的一个示例,它将一半文本更改为蓝色:Javascript 突出显示google文档中的word,javascript,html,google-docs,google-document-viewer,Javascript,Html,Google Docs,Google Document Viewer,有没有办法突出显示使用google doc查看的docx文件中的特定单词 例如: 我有以下文档,我正在使用谷歌文档查看它,我需要在文档中用另一种颜色突出显示“Step”字 除了打开文档、编辑文档、保存文档然后将其返回到Google doc viewer之外,还有其他可用的方法吗?您可以使用这些方法创建、访问和修改Google doc文件 以下是文档中的一个示例,它将一半文本更改为蓝色: var body = DocumentApp.getActiveDocument().getBody();
var body = DocumentApp.getActiveDocument().getBody();
// Use editAsText to obtain a single text element containing
// all the characters in the document.
var text = body.editAsText();
// Insert text at the beginning of the document.
text.insertText(0, 'Inserted text.\n');
// Insert text at the end of the document.
text.appendText('\nAppended text.');
// Make the first half of the document blue.
text.setForegroundColor(0, text.getText().length / 2, '#00FFFF');
要突出显示特定单词,可以使用 我认为这是一个很好的解决方案,但是你知道如何在我的html项目中注册GoogleApple脚本吗?由于我在谷歌文档中没有找到任何文章,所以只能将其用于使用谷歌网站构建的网站。