0
我不知道如何找到偏移值使用insertText方法使用谷歌腳本如何找到抵消插入文本
我的谷歌文檔應該看一些東西一樣
第1款
款2
跟蹤錯誤:567587
第3段
所有段落數據都從excel中提取並寫入文檔
使用附加段落我無法僅爲'567587'使用url。下面的腳本是迄今爲止我創建
var doc=DocumentApp.openById('abcxxdcdcd').getBody();
var text=doc.editAsText();
doc.appendParagraph('paragraph1');
doc.appendParagraph('paragraph2');
doc.appendParagraph('Tracking bug: ');
//I want to insert text next to the above paragraph 'Tracking bug: ' which means I need to find the offset of the location.
text.insertText(offset,567587).setLinkUrl(startOffset, endOffsetInclusive, url)
注:我沒有使用此文件的約束容器。
謝謝,也請你提一下如何找到抵消位置 – user2326333