Add Method (PageWindows Collection) Example

This example adds the Inventory page for Rogue Cellars winery to the list of items in the PageWindows collection. When you add a page using the FileUrl argument, the page that you want to add must exist as a file—you cannot create a new page using this argument. To create an unsaved new page, refer to the description in the Add method.

Note   To run this example, you must have a web called "C:\My Documents\My Webs\Rogue Cellars" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars" (for a server running on Windows NT) and a file called Inventory.htm. Or, you may substitute an alternative web URL or file.

Private Sub AddPage()
Dim myPageWindows As PageWindows
Dim myPage As String

Set myPageWindows = ActiveWeb.ActiveWebWindow.PageWindows
myPage = "C:\My Documents\My Webs\Rogue Cellars\Inventory.htm"

myPageWindows.Add (myPage)
End Sub