如何将光标移动到文档末尾?

2024-01-04

我想将光标移动到脚本开头的文档末尾。我怎么做?

我已经知道如何将光标移动到文档的开头,如下所述here https://stackoverflow.com/questions/26945026/how-can-i-move-the-cursor-to-the-beginning-of-the-document-with-google-apps-scri.


你可以尝试这样的事情:

function setCursorToEnd() {
  var doc = DocumentApp.getActiveDocument();
 var paragraph = doc.getBody().appendParagraph('');
 var position = doc.newPosition(paragraph, 0);
 doc.setCursor(position);
}

但这可能不是最有效的方法

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何将光标移动到文档末尾? 的相关文章

随机推荐