Share via


PageWindowEx Object

PageWindowEx
Multiple objects

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 PageWindowEx object is a member of the PageWindows collection and represents all of the open page windows in the specified Web site. Within the PageWindows collection, individual PageWindowEx 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 PageWindowEx object. This only works when the PageWindowEx object has already been saved. The following statements return the PageWindowEx object for an open page window that has a caption of "C:\My Web Sites\Coho Winery\Zinfandel.htm").

Set objPageWindow = ActiveWebWindow.PageWindow("Zinfandel.htm")
Set objPageWindow = 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 PageWindowEx object. The following statement returns the file URL of the first page window item in the PageWindows collection.

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

Use the ActiveFrameWindow property to return the active frame of a PageWindowEx 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 objActiveFrame _
    = WebWindows(1).ActivePageWindow.ActiveFrameWindow

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

objFrameWindow = WebWindows(0).ActivePageWindow.FrameWindow

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

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

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

Private Sub CheckPageWindowIsDirty()
    Dim objPageWin As PageWindowEx

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

    If objPageWin.IsDirty = True Then
        objPageWin.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

Properties | ActiveDocument Property | ActiveFrameWindow Property | Application Property | Caption Property | Document Property | File Property | FrameWindow Property | IsDirty Property | Parent Property | PreviewDocument Property | ThemeProperties Property | ViewMode Property | Visible Property | Web Property

Methods | Activate Method | ApplyTheme Method | Close Method | Refresh Method | Save Method | SaveAs Method

Events | OnActivate Event | OnAfterSave Event | OnAfterViewChange Event | OnBeforeSave Event | OnBeforeViewChange Event | OnClose Event

Parent Objects

Child Objects | Web Object | WebFile Object