The
Save All command does not exist in FrontPage 2000. However, you can easily implement it by using Visual Basic for Applications. The following code checks to see if any changes have been made to each open file since the last save. If changes have been made, it saves the file. This code requires that a web is open.
Sub SaveAll()
' First check to make sure that a page is open.
If (ActiveWebWindow.PageWindows.Count > 0) Then
' If a page is open, set up variables.
Dim myCurrentPage, myPageWindow As PageWindow
' Set myCurrentPage to the currently active page so we can go
' back to this page when the macro is finished running.
Set myCurrentPage = ActivePageWindow
' Now loop through each page in the web.
For Each myPageWindow In ActiveWebWindow.PageWindows
' Activate the page so we can save it.
myPageWindow.Activate
' Check to see if changes have been made to this page.
If myPageWindow.IsDirty Then
' Execute the Save command on the File menu
CommandBars("File").Controls("&Save").Execute
End If
Next
'Once the macro has finished, reactivate the original page.
myCurrentPage.Activate
End If
End Sub
Note About the Code
The
Save method of the
PageWindow object could have been used to save the pages. However, the
Save method will not save a page if the page has never been saved since its creation (for example, new_page_1.htm). In that case, the
SaveAs method must be used to save the unsaved page. Because the
SaveAs method does not allow you to display a
SaveAs dialog box to save the new page under a new name, this example chose to use the
Execute method to save the pages.