取得 [視覺報表範本的路徑和檔案名稱。 唯讀的 String。
語法
expression。 TemplatePath
詞 一個代表 ReportTemplate 物件的變數。
註解
Visual Report 範本檔案儲存在每個使用者的以下目錄中,其中 LCID 是語言代碼識別碼,例如美式英語的 1033: C:\Users\[UserAlias]\AppData\Roaming\Microsoft\Templates\[LCID]\。 例如,adr1.xlt 為 Microsoft Excel 範本。
範例
下列範例會列出目前使用者的所有視覺報表範本類型及檔案。
Sub ListTemplatePaths()
Dim templateList As String
Dim typeOfTemplate As String
Dim template As ReportTemplate
For Each template In Application.VisualReportTemplateList
Select Case template.templateType
Case pjExcel
typeOfTemplate = "Excel"
Case pjVisioMetric
typeOfTemplate = "Visio Metric"
Case pjVisioUS
typeOfTemplate = "Visio U.S."
Case Else
End Select
templateList = templateList & vbCrLf & typeOfTemplate & ": " _
& template.TemplatePath
Next template
MsgBox "Visual Reports Templates:" & templateList
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。