如何将光标移动到文档的末尾? [英] How do I move the cursor to the end of the document?
本文介绍了如何将光标移动到文档的末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将光标移动到脚本开头的文档末尾.我该怎么办?
I want to move the cursor to the end of the document in the beginning of my script. How do I do that?
I already know how to move the cursor to the beginning of the document as described here.
推荐答案
您可以尝试执行以下操作:
You can try something like this:
function setCursorToEnd() {
var doc = DocumentApp.getActiveDocument();
var paragraph = doc.getBody().appendParagraph('');
var position = doc.newPosition(paragraph, 0);
doc.setCursor(position);
}
虽然这可能不是最有效的方法
It might not be the most efficient way though
这篇关于如何将光标移动到文档的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文