DefaultViewPage 属性

       

返回或设置 String 类型的值,该值定义了列表打开时所查看的网页的相对 URL。此属性定义了“属性”对话框“支持文件”选项卡上的默认查看网页域。可读写。

expression.DefaultViewPage

expression  必选。返回“应用于”列表中的对象之一的表达式。

说明

默认启动页面是 AllItems.htm。

示例

下列示例列出文档中所有列表的名称以及与其对应的默认查看网页的 URL。该子例程创建一个字符串,其中包含所有列表名称以及默认查看网页,并向用户显示此带格式的消息。

Sub ViewDefaultPage()
'Lets the user view the default view
'page for all lists in the web.

    Dim lstWebList As List
    Dim strURL As String

    If Not ActiveWeb.Lists Is Nothing Then
        'Cycle through lists
        For Each lstWebList In ActiveWeb.Lists
            'add default view pages names to string
            If strURL = "" Then
                strURL = lstWebList.Name & "  -  " & _
                lstWebList.DefaultViewPage & vbCr
            Else
                strURL = strURL & lstWebList.Name & "  -  " & _
                lstWebList.DefaultViewPage & vbCr
            End If
        Next
        'Display default view pages of all lists
        MsgBox "The default view pages of all lists in the current web are:" _
               & vbCr & vbCr & strURL
    Else
        'Otherwise display message to user
        MsgBox "The current web contains no lists."
    End If

End Sub