Table of contents
TOC
折叠目录
展开目录

Chart.Delete 方法 (项目)Chart.Delete Method (Project)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

删除图表中的活动的报告。Deletes a chart on an active report.

语法Syntax

表达式删除expression. Delete

表达式_一个表示图表对象的变量。_expression A variable that represents a Chart object.

返回值Return value

VariantVariant

示例Example

下面的示例显示一份报告,然后删除报表上的所有图表。The following example displays a report, and then deletes all charts on the report.

Sub DeleteCharts()
    Dim chartReport As Report
    Dim chartShape As Shape
    Dim reportName As String

    ' Display a report.
    reportName = "Chart Report 1"
    Set chartReport = ActiveProject.Reports(reportName)
    chartReport.Apply

    ' Delete every chart on the report.
    For Each chartShape In chartReport.Shapes
        If chartShape.Type = msoChart Then
            Debug.Print "Deleting chart: '" &; chartShape.Name _
                &; "' from report: " &; reportName
            chartShape.Delete
        End If
    Next chartShape
End Sub

另请参阅See also

其他资源Other resources

图表对象Report.Delete 方法Chart ObjectReport.Delete Method

© 2018 Microsoft