PageWindows Collection Object

See Also         Properties         Methods        

Application object
WebWindows object
WebWindow object
PageWindows object

A collection of PageWindow objects. Each PageWindow object represents an open web page in a Microsoft FrontPage application window. The PageWindow 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 PageWindow object. The following statement returns the first PageWindow 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 Webs\myWebOne\bugrep.htm")

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

myAppName = WebWindows.PageWindows.Application.Name

Use the Close method to close a PageWindow object or the collection of open PageWindows. The following statement closes the fourth PageWindow object for the first WebWindow 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 PageWindow 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 PageWindow 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 WebWindow container object for the first PageWindow object using the Parent property.

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