报告对象 (Project)

包含 Report 对象的集合,其中每个报表都是自定义报表。

示例

Reports 对象是项目中自定义报表的集合。 它不包括内置报表,例如“项目概述”、“关键任务”“里程碑报表”。 使用 Project.Reports 属性获取 Reports 集合对象,如以下示例所示:

Sub ListCustomReports()
    Dim oReport As Report
    Dim msg As String
    Dim msgBoxTitle As String
    msg = ""
    msgBoxTitle = "Custom reports in '" & ActiveProject.Name & "'"
    
    For Each oReport In ActiveProject.Reports
        msg = msg & oReport.Index & ": " & oReport.Name & vbCrLf
    Next oReport
        
    If ActiveProject.Reports.Count > 0 Then
        MsgBox Prompt:=msg, Title:=msgBoxTitle
    Else
        MsgBox Prompt:="This project contains no custom reports.", _
            Title:=msgBoxTitle
    End If
End Sub

方法

名称
Add
Copy
IsPresent

属性

名称
Application
Count
项目
Parent

另请参阅

报表对象

Project.Reports 属性

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。