PageWindows Collection

Microsoft FrontPage Visual Basic

PageWindows Collection

Multiple objects PageWindows
PageWindow
Multiple objects

A collection of PageWindowEx objects. Each PageWindowEx object represents an open Web page in a Microsoft FrontPage application window. The PageWindowEx object is a member of the PageWindows collection.

Using the PageWindows object

Use the PageWindows property to return the PageWindows collection. The following statement returns the PageWindows object to the myPages variable.

    myPages = WebWindows(0).PageWindows
  

Use PageWindows(index), where index is the index number of an item in the PageWindows collection, to return a single PageWindowEx object. The following statement returns the first PageWindowEx object in the collection.

    Set myPageWindow = WebWindows(0).PageWindows(0)
  

Use the Add method to add a page window to the PageWindows collection. The following example opens the specified page in myWebOne and adds the page to the PageWindows collection.

    Dim myPageWindows As PageWindows
Set myPageWindows = ActiveWeb.WebWindows(0).PageWindows
myPageWindows.Add("C:\My Web Sites\myWebOne\bugrep.htm")
  

Use the Application property to return the Application object from the PageWindows collection. The following example returns the Application object from the PageWindows collection.

    myAppName = WebWindows.PageWindows.Application.Name
  

Use the Close method to close a PageWindowEx object or the collection of open PageWindows. The following statement closes the fourth PageWindowEx object for the first WebWindowEx object.

    WebWindows(0).PageWindows(3).Close
  

Use Close(index), where index is the index number of an item in the PageWindows collection, to close a single PageWindowEx object as shown in the following statements. Both statements close the same page window. In the first statement, you close the page window using the index number for the Close method, while in the second statement, you close the page window by specifying the index number for the page you want to close.

    WebWindows(0).PageWindows.Close(2)
WebWindows(0).PageWindows(2).Close
  

Use Close() to close all of the open PageWindowEx objects in the PageWindows collection. The following statement closes all of the open pages in the PageWindows collection.

    WebWindows(0).PageWindows.Close()
  

Use the Count property to return the total number of page windows in the PageWindows collection. The following example returns the number of page windows in the collection of PageWindows.

    myPageCount = WebWindows(0).PageWindows.Count
  

Use the Parent property when you want to return the container for the PageWindows collection. The following statement returns the WebWindowEx container object for the first PageWindowEx object using the Parent property.

    Set myParent = ActiveWeb.WebWindows(0).PageWindows.Parent