The method below is one way to loop through all pages of the Active Web.
It is set to only open .htm files.
Sub LoopThroughAllPages()
On Error GoTo errHandler1
Dim i As Long
Dim strExt As String
Dim blnChanged As Boolean
For i = 0 To WebDesigner.Application. _
ActiveWeb.AllFiles.Count - 1
strExt = Application.ActiveWeb. _
AllFiles.Item(i).Extension
'Limit the files to be opened to htm files.
If strExt = "htm" Then
Application.ActiveWeb.AllFiles.Item(i).Open
'Code to Process Each Page Goes Here.
'blnChanged is set to true
'if changes have been made
'otherwise left at false
'so page does not need to be saved.
If blnChanged = True Then
WebDesigner.ActivePageWindow.Save True
blnChanged = False
End If
WebDesigner.ActivePageWindow. _
Close False, False
End If
Next i
Exit Sub
errHandler1:
MsgBox _
"Err.Number: " & Err.Number & vbCrLf & _
"Err.Description: " & Err.Description, _
vbCritical, "GetQualifiedFileNames Function " & _
"had a Fatal Error."
End Sub