取得專案中的自訂報告集合。 唯讀 報告。
語法
expression。 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
屬性值
報告
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。