Returns a WebFiles collection that represents all files in the current web.
expression.AllFiles
expression Required. An expression that returns one of the objects in the Applies To list.
The WebFiles collection returns all files in the collection regardless of their position in the web hierarchy.
The following example searches through the WebFiles collection for a page with the title Main Page. If the page is found, it is opened in Microsoft FrontPage.
Sub FindFileTitle()
'Returns a collection of all files in the current web.
Dim objApp As FrontPage.Application
Dim objWebFile As WebFile
Dim objWebFiles As WebFiles
Set objApp = FrontPage.Application
'Create a reference to the WebFiles collection
Set objWebFiles = objApp.ActiveWeb.AllFiles
'Check each file in the collection for the title Main Page
For Each objWebFile In objWebFiles
'If the title is found open the page in the editor.
If objWebFile.Title = "Main Page" Then
'Open page
objWebFile.Open
End If
'If not found, check next file.
Next objWebFile
End Sub