Template 属性


返回或设置 String 类型的值,该值代表应用于文档库的模板的文件路径。可读写。


expression  必选。返回 DocumentLibrary 对象的表达式。


下列示例创建对名为 NewLibrary 的文档库的引用,并显示与该库相关联的模板的文件路径。

Sub TemplatePath()
'Displays the file path of the template

    Dim objApp As FrontPage.Application
    Dim objLists As Lists
    Dim objLibrary As DocumentLibrary

    Set objApp = FrontPage.Application
    Set objLists = objApp.ActiveWeb.Lists

    Set objLibrary = objLists.Item("NewLibrary")

    'Display message to user
    MsgBox "The file path of the template associated with the " & _
            "document library is " & objLibrary.Template & "."

End Sub