DefaultViewPage Property

Microsoft FrontPage Visual Basic

DefaultViewPage Property

Returns or sets a String that defines the relative URL to the page that is viewed when the list is opened. This property corresponds to the default view page field on the Supporting Files tab of the Properties dialog box.

expression.DefaultViewPage

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

The default start page is AllItems.htm.

Example

The following example lists the names of all lists in the document and their corresponding default view page URLs. The subroutine creates a single string containing all list names and default view pages and displays the formatted message to the user.

    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