共用方式為


Project) (Application.VisualReportsView 方法

會以指定的時間層級開啟指定的視覺報表範本。

語法

expression. VisualReportsView( _strVisualReportTemplateFile_, _PjVisualReportsDataLevel_ )

expression 代表 Application 物件的變數。

參數

名稱 必要/選用 資料類型 描述
strVisualReportTemplateFile 選用 String 範本檔案的完整路徑與名稱。
PjVisualReportsDataLevel 選用 Long 自動決定或指定從天年的資料的時間層級。 可以是 PjVisualReportsDataLevel 常數之一。 預設值為 pjLevelAutomatic

傳回值

布林值

註解

PjVisualReportsDataLevel參數會指定可存取時段資料的層級。 例如,如果 pjLevelMonths (月數) 指定,則它可能無法予以存取 pjLevelDays (天)。

以資料不支援的時間層級開啟範本,會導致錯誤。

範例

以下範例會開啟 "PCRTSK_U.VST" 範本以進行檢視。

Sub a() 
 Dim tf As Boolean 
 tf = Application.VisualReportsView("D:\Program Files\Microsoft Office\Office12\1033\PCRTSK_U.VST", pjLevelAutomatic) 
 If tf = True Then 
 MsgBox ("Template was viewed successfully") 
 Else 
 MsgBox ("Template was not viewed successfully") 
 End If 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應