Class Border
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
详细文档
getDashStyle()
获取边框的 DashStyle
。
返回
DashStyle
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getLineFill()
获取边框的 LineFill
。
返回
LineFill
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getWeight()
获取边框的厚度(以像素点为单位)。如果元素没有边框,则返回 null
。
返回
Number
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
isVisible()
获取边框是否可见。
返回
Boolean
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
setDashStyle(style)
设置边框的 DashStyle
。
在透明边框上设置 DashStyle
会使其可见。
参数
返回
Border
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
setTransparent()
将边框设置为透明。
返回
Border
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
setWeight(points)
设置边框的厚度(以像素为单位)。
为透明边框设置粗细会使其可见。
参数
返回
Border
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eBorder\u003c/code\u003e describes the border around an element and provides methods to manipulate its appearance.\u003c/p\u003e\n"],["\u003cp\u003eYou can get and set the border's dash style, line fill, thickness, and visibility using dedicated methods.\u003c/p\u003e\n"],["\u003cp\u003eSetting a dash style or weight on a transparent border makes it visible.\u003c/p\u003e\n"],["\u003cp\u003eAll methods require authorization with specific scopes for accessing and modifying presentations.\u003c/p\u003e\n"]]],["The document outlines how to interact with an element's border. Key actions include getting the border's `DashStyle`, `LineFill`, weight (thickness), and visibility status. You can set the border's `DashStyle`, make it transparent, or adjust its weight in points. Setting a dash style or weight on a transparent border makes it visible. Each method requires specific authorization scopes. The get weight method returns null if the element does not have a border.\n"],null,["# Class Border\n\nBorder\n\nDescribes the border around an element. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------|\n| [getDashStyle()](#getDashStyle()) | [DashStyle](/apps-script/reference/slides/dash-style) | Gets the [DashStyle](/apps-script/reference/slides/dash-style) of the border. |\n| [getLineFill()](#getLineFill()) | [LineFill](/apps-script/reference/slides/line-fill) | Gets the [LineFill](/apps-script/reference/slides/line-fill) of the border. |\n| [getWeight()](#getWeight()) | `Number` | Gets the thickness of the border in points. |\n| [isVisible()](#isVisible()) | `Boolean` | Gets whether the border is visible or not. |\n| [setDashStyle(style)](#setDashStyle(DashStyle)) | [Border](#) | Sets the [DashStyle](/apps-script/reference/slides/dash-style) of the border. |\n| [setTransparent()](#setTransparent()) | [Border](#) | Sets the border to be transparent. |\n| [setWeight(points)](#setWeight(Number)) | [Border](#) | Sets the thickness of the border in points. |\n\nDetailed documentation\n----------------------\n\n### `get``Dash``Style()`\n\nGets the [DashStyle](/apps-script/reference/slides/dash-style) of the border.\n\n#### Return\n\n\n[DashStyle](/apps-script/reference/slides/dash-style)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Line``Fill()`\n\nGets the [LineFill](/apps-script/reference/slides/line-fill) of the border.\n\n#### Return\n\n\n[LineFill](/apps-script/reference/slides/line-fill)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Weight()`\n\nGets the thickness of the border in points. Returns `null` if the element does not have a\nborder.\n\n#### Return\n\n\n`Number`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `is``Visible()`\n\nGets whether the border is visible or not.\n\n#### Return\n\n\n`Boolean`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `set``Dash``Style(style)`\n\nSets the [DashStyle](/apps-script/reference/slides/dash-style) of the border.\n\nSetting a [DashStyle](/apps-script/reference/slides/dash-style) on a transparent border makes it visible.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|-------------------------------------------------------|-------------|\n| `style` | [DashStyle](/apps-script/reference/slides/dash-style) | |\n\n#### Return\n\n\n[Border](#)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `set``Transparent()`\n\nSets the border to be transparent.\n\n#### Return\n\n\n[Border](#)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `set``Weight(points)`\n\nSets the thickness of the border in points.\n\nSetting a weight on a transparent border makes it visible.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|----------|-------------|\n| `points` | `Number` | |\n\n#### Return\n\n\n[Border](#)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`"]]