Chart.SetElement 方法 (Word)
设置图表上图表元素。 读/写 MsoChartElementType 。
语法
表达式。SetElement (元素)
expression:一个表示 Chart 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
元素 | 必需 | MsoChartElementType | 用于指定图表元素类型的枚举值之一。 |
备注
对于图表,在 布局选项卡中的以下命令对应的 SetElement 方法:
"标签" 组中的全部内容。
"坐标轴" 组中的全部内容。
"分析" 组中的全部内容。
"绘图区"、 "图表背景墙" 和 "图表基底" 按钮。
MsoChartElementType 是一个枚举常量引用的所有上述命令。
示例
以下示例使用不同常量值为活动图表设置图表元素。
With ActiveDocument.InlineShapes(1)
If .HasChart Then
With .Chart
' Select the major gridlines on the value axis.
.Axes(xlValue).MajorGridlines.Select
.SetElement msoElementChartTitleCenteredOverlay
.SetElement msoElementPrimaryCategoryGridLinesMinor
' Select the walls.
.Walls.Select
.SetElement msoElementChartFloorShow
End With
End If
End With
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。