How to find a Word in a Document and insert a url
问题 How can I insert a hyperlink on a particular word in a google-drive document? I can find the word. After that, I want to assign a hyperlink. I used this code: doc.editAsText().findText("mot").setLinkUrl("https://developers.google.com/apps-script/class_text"); My doc is DocumentApp, and this works when done using the UI. However, the code above does not work. How can I perform this task? 回答1: With the help of the utility function below, you can do this: linkText("mot","https://developers