PageWindow Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

                          






Represents an open editor session and encapsulates the Microsoft FrontPage Page object model that is compatible with the document object model for Microsoft Internet Explorer 4.0 and later. The PageWindow object is a member of the PageWindows collection and represents all of the open page windows in the specified web. Within the PageWindows collection, individual PageWindow objects are indexed beginning with zero.

Note   You can also substitute the Caption property of the PageWindow object instead of the index number when accessing a PageWindow object. The following statements return the PageWindow object for an open page window that has a caption of "C:\My Webs\Rogue Cellars\Zinfandel.htm").

Set myPageWindow = ActiveWebWindow.PageWindow("Zinfandel.htm")
Set myPageWindow = WebWindows(0).PageWindow("Zinfandel.htm")

Using the PageWindow Object

Use PageWindows(index), where index is the index number of a page window item, to return a single PageWindow object. The following statement returns the file URL of the first page window item in the PageWindows collection.

myPageOne = WebWindows(0).PageWindows(0).Document.Url

Use the ActiveFrameWindow property to return the active frame of a PageWindow object. The following statement returns the ActiveFrameWindow object.

Note   The active frame is the frame that currently has the focus, it is shown in FrontPage with a blue border surrounding it.

Set myActiveFrame _
    = WebWindows(1).ActivePageWindow.ActiveFrameWindow

Use the FrameWindow property to return an IHTMLWindow2 object, which can then be used to return the frames collection and the content of each of the frames collection pages.

myFrameWindow = WebWindows(0).ActivePageWindow.FrameWindow

Use the Document property to return the document associated with the PageWindow object. The following statement returns the document associated with the first PageWindow object of the first WebWindow object.

Set myDoc = WebWindows(0).PageWindows(0).Document

You can use the IsDirty property to determine if the PageWindow object is dirtythat is, it has been modified since the last refresh or save. Returns True if the PageWindow object is dirty. The following example saves the PageWindow object if the first item in the PageWindows collection is dirty.

Private Sub CheckPageWindowIsDirty()
Dim myPageWin As PageWindow

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

If myPageWin.IsDirty = True Then
    myPageWin.Save
End If
End Sub

You can use the ViewMode property to set the view for the page as shown in the following statement. For more information on the enumerated constants available for this property, see the table under the ViewMode property.

WebWindows(1).PageWindows(1).ViewMode = fpPageViewHtml