我正在使用 google 应用程序脚本,我正在尝试使用一个按钮来粘贴“运动—_____ 移动和 _____ 附注了_____”。在谷歌档案中。为了仅突出显示前六个字母,我使用了以下代码,但我不断收到此错误讯息:
而不是(1, 6, true)我也试过(parseInt('1'),parseInt('6'),true), 和(one, six, true), ('one', 'six', true)。它要我做什么?
function motion() {
var body = DocumentApp.getActiveDocument().getBody();
var par1m = body.appendParagraph('Motion—_____ moved and _____ seconded that _____.');
par1m.setBold(1, 6, true);
par1m.setItalic(false);
par1m.setUnderline(false);
par1m.setStrikethrough(false);
par1m.setFontFamily("Times New Roman");
par1m.setFontSize(12);
par1m.setForegroundColor('#000000');
par1m.setAlignment(DocumentApp.HorizontalAlignment.LEFT);```
uj5u.com热心网友回复:
Paragraph没有记录的 setBold()属性。Text做。使用editAsText()得到一个Text版本:
var par1m = body.appendParagraph('Motion—_____ moved and _____ seconded that _____.').editAsText();
0 评论