的getAttributes()和其他相关方法只返回NULL(getAttributes() and

2019-10-21 06:31发布

我有一个非常简单的代码,将复制格式刷按钮尝试。 (我想要的格式从第一段复制)。

然而,当我打电话段落getAttributes方法(),仅下划线,粗体,斜体和航向值得到。 对于所有其他属性,如FOREGROUND_COLOR返回NULL

到目前为止我的代码是:

var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
var par = body.getParagraphs();
Logger.log(par[0].getAttributes()); 

从文档,如果该段有多个值相同的属性属性,但不是的情况下返回值是

谢谢

文章来源: getAttributes() and other related methods return only null