【问题标题】:Google Apps Script - Google Document : Find headings attributesGoogle Apps 脚本 - Google 文档:查找标题属性
【发布时间】:2014-10-24 09:18:22
【问题描述】:
我正在尝试阅读 google 文档以查找样式属性。例如,获取标题为“Heading 1”的段落,然后获取样式属性。但是所有属性都是'null'。我不知道在哪里可以找到有关使用 GAS 的(标题属性)的信息。
【问题讨论】:
标签:
google-apps-script
styles
google-docs
【解决方案1】:
这些是代码编辑器自动完成帮助中列出的所有属性:
style[DocumentApp.Attribute.BACKGROUND_COLOR
style[DocumentApp.Attribute.BOLD
style[DocumentApp.Attribute.BORDER_COLOR
style[DocumentApp.Attribute.BORDER_WIDTH
style[DocumentApp.Attribute.CODE
style[DocumentApp.Attribute.FONT_FAMILY
style[DocumentApp.Attribute.FONT_SIZE
style[DocumentApp.Attribute.FOREGROUND_COLOR
style[DocumentApp.Attribute.GLYPH_TYPE
style[DocumentApp.Attribute.HEADING
style[DocumentApp.Attribute.HEIGHT
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT
style[DocumentApp.Attribute.INDENT_END
style[DocumentApp.Attribute.INDENT_FIRST_LINE
style[DocumentApp.Attribute.INDENT_START
style[DocumentApp.Attribute.ITALIC
style[DocumentApp.Attribute.LEFT_TO_RIGHT
style[DocumentApp.Attribute.LINE_SPACING
style[DocumentApp.Attribute.LINK_URL
style[DocumentApp.Attribute.LIST_ID
style[DocumentApp.Attribute.MARGIN_BOTTOM
style[DocumentApp.Attribute.MARGIN_LEFT
style[DocumentApp.Attribute.MARGIN_RIGHT
style[DocumentApp.Attribute.MARGIN_TOP
style[DocumentApp.Attribute.MINIMUM_HEIGHT
style[DocumentApp.Attribute.NESTING_LEVEL
style[DocumentApp.Attribute.PADDING_BOTTOM
style[DocumentApp.Attribute.PADDING_LEFT
style[DocumentApp.Attribute.PADDING_RIGHT
style[DocumentApp.Attribute.PADDING_TOP
style[DocumentApp.Attribute.PAGE_HEIGHT
style[DocumentApp.Attribute.PAGE_WIDTH
style[DocumentApp.Attribute.SPACING_AFTER
style[DocumentApp.Attribute.SPACING_BEFORE
style[DocumentApp.Attribute.STRIKETHROUGH
style[DocumentApp.Attribute.UNDERLINE
style[DocumentApp.Attribute.VERTICAL_ALIGNMENT
style[DocumentApp.Attribute.WIDTH