Application.VisualReportsView 方法 (Project)

打开具有指定时间级别的指定“可视报表”模板。

语法

expression. VisualReportsView( _strVisualReportTemplateFile_, _PjVisualReportsDataLevel_ )

expression:表示 Application 对象的变量。

参数

名称 必需/可选 数据类型 说明
strVisualReportTemplateFile 可选 String 模板文件的完整路径和名称。
PjVisualReportsDataLevel 可选 Long 时间的数据,自动确定或指定的时间从数天到年级别。 可以是 PjVisualReportsDataLevel 常量之一。 默认值是 pjLevelAutomatic

返回值

Boolean

说明

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 支持和反馈,获取有关如何接收支持和提供反馈的指南。