PageWindows Collection

SharePoint Designer Developer Reference

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

Remarks

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

Visual Basic for Applications
Set 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.

Visual Basic for Applications
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.

Visual Basic for Applications
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.

Visual Basic for Applications
myAppName = WebWindows(0).PageWindows.Application.Name

Use the Close method to close a PageWindow object or the collection of open PageWindow objects. The following statement closes the fourth PageWindow object for the first WebWindow object.

Visual Basic for Applications
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 by 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.

Visual Basic for Applications
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.

Visual Basic for Applications
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 PageWindows collection.

Visual Basic for Applications
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 object for the first PageWindow object using the Parent property.

Visual Basic for Applications
Set myParent = ActiveWeb.WebWindows(0).PageWindows.Parent

See Also